Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse for 'send_private_file' not found. Django 4.0 #72

Open
jodusan opened this issue Dec 12, 2021 · 1 comment
Open

Reverse for 'send_private_file' not found. Django 4.0 #72

jodusan opened this issue Dec 12, 2021 · 1 comment

Comments

@jodusan
Copy link

jodusan commented Dec 12, 2021

Do I have to name the view as 'send_private_file' ?

I get the following error

django.urls.exceptions.NoReverseMatch: Reverse for 'serve_private_file' not found. 'serve_private_file' is not a valid view function or pattern name.

@Chrescht
Copy link

Chrescht commented Jan 12, 2022

I solved it by removing the url import lines from app/urls.py to project/urls.py.
project/urls.py:

...
import private_storage.urls
urlpatterns = [
    ...
    path('app/', include(('app.urls', 'app'), namespace='app')),
    re_path('^private-media/', include(private_storage.urls)),
]

This happened most likely because I have namespaces defined in app/urls.py so the private_storage.urls were not visible any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants