from django.contrib.auth.views import login

212 views
Skip to first unread message

Ahmad

unread,
Jul 7, 2018, 7:42:53 AM7/7/18
to Django users
hello everyone, 

when i import this line it's not working. 
from django.contrib.auth.views import login

My Django Versions is 2.0



from django.conf.urls import url
from . import views
from django.contrib.auth.views import login

urlpatterns = [
    url(r'^$',views.home),
    url(r'^login/$', login, {'template_name': 'accounts/login.html'}),
  
]


error : 


 from django.contrib.auth.views import login
ImportError: cannot import name 'login'

Jason

unread,
Jul 7, 2018, 7:50:51 AM7/7/18
to Django users

Phako Perez

unread,
Jul 7, 2018, 11:16:49 AM7/7/18
to django...@googlegroups.com
hi,

instead of 

from django.contrib.auth.views import login

you need to use 
from django.contrib.auth import login
regards.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a97b6e1a-0990-4ab7-9833-37a0d10b8df6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages