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 'login' not found. 'login' is not a valid view function or pattern name. #56

Open
Sanrrone opened this issue Apr 9, 2021 · 4 comments

Comments

@Sanrrone
Copy link

Sanrrone commented Apr 9, 2021

Dears,
when I try to connect from app1/client to app0/server, I got from the server the error:

Reverse for 'login' not found. 'login' is not a valid view function or pattern name.
It comes from

"server.py", line 93, in handle_unauthenticated_user

url = '%s?%s' % (reverse(self.server.auth_view_name), urlencode([('next', next)]))

I tried to create a login view in the server with no results (same error).

what can I do?

thanks in advance!

@faizan-py
Copy link

Facing the same issue, Did you find the solution?

@sccox
Copy link

sccox commented Mar 12, 2022

@fznshk on your server you'll want to add:
from django.contrib.auth import views as auth_views

path('login/', auth_views.LoginView.as_view(), name='login'),
to urls.py
and you'll also need to configure your templates and add a login view.

@marcosatinel
Copy link

thanks

@JElbourne
Copy link

I would suggest we add the default setup of Django Auth Urls to the README, unless users want to manage all the urls needed individually.

path('accounts/', include('django.contrib.auth.urls')),

Also add your 'registration' directory to 'templates' and add in your login.html file.

You can follow the quick start tutorial on Django site.
https://docs.djangoproject.com/en/4.2/topics/auth/default/

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

5 participants