Al 11/08/12 19:48, En/na Jonathan Hayward ha escrit:
I have a Django project with the root view @login_required, and I'm not
sure how to populate /accounts so that that heirarchy will hangle
login-related information. The Django Book at
https://docs.djangoproject.com/en/dev/topics/auth/ seems to say that it
will happen automagically with my default settings.py:

...

When I decorate my root view with @login_required, I get redirected to
http://localhost:8000/accounts/login/?next=/, which presents the Django
debug mode 404 page.

Probably you have forgot adding:

urlpatterns = patterns(
  ...
  url(r"^accounts/", include("django.contrib.auth.urls"))
  ...
)

to your root urlconf. That's required in order to "activate" the auth related views.

If you get a TemplateDoesNotExist error the next step is to create a "registration/login.html" template in order to display the login form.


HTH

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to