divio / django-simple-sso

Other
307 stars 116 forks source link

Reverse for 'login' not found. 'login' is not a valid view function or pattern name. #56

Open Sanrrone opened 3 years ago

Sanrrone commented 3 years ago

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 commented 2 years ago

Facing the same issue, Did you find the solution?

sccox commented 2 years ago

@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 commented 2 years ago

thanks

JElbourne commented 10 months ago

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/