hi, instead of
from django.contrib.auth.views import login you need to use from django.contrib.auth import login regards. On Sat, Jul 7, 2018 at 6:41 AM, Ahmad <[email protected]> wrote: > 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' > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > 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 > <https://groups.google.com/d/msgid/django-users/a97b6e1a-0990-4ab7-9833-37a0d10b8df6%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAF%3Duzp3WLbxyNUORJKNs9L5MTG%2B7xDOoCO40CqCpsMGDUN554Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

