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

module 'django.contrib.auth.views' has no attribute 'login' #2

Open
JoeHitHard opened this issue Jan 7, 2019 · 2 comments
Open

module 'django.contrib.auth.views' has no attribute 'login' #2

JoeHitHard opened this issue Jan 7, 2019 · 2 comments

Comments

@JoeHitHard
Copy link

JoeHitHard commented Jan 7, 2019

I'm trying to run migrations but I am facing this error

@chiillax
Copy link

You are facing this error because of older version of django (latest version is 2.2).
To fix it change urlpatterns from these :
url(r'^login/$', auth_views.login, {'template_name': 'login.html'}, name='login'),
url(r'^logout/$', auth_views.logout, {'template_name': 'logged_out.html'}, name='logout'),
to :
url(r'^login/$', auth_views.LoginView.as_view(template_name='login.html'), name='login'),
url(r'^logout/$', auth_views.LogoutView.as_view(template_name='logged_out.html'), name='logout'),

and in setting.py file change MIDDLEWARE_CLASSES to MIDDLEWARE and remove 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',

@danieljfarrell
Copy link

Or just pull from the pull request #3 that is currently open,

git clone https://github.com/chiillax/simple-django-login

PiyushDive added a commit to PiyushDive/simple-django-login that referenced this issue Oct 7, 2023
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

3 participants