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:
"Authentication support is bundled as a Django application in
django.contrib.auth. To install it, do the following:

"Put 'django.contrib.auth' and 'django.contrib.contenttypes' in your
INSTALLED_APPS setting [*they are there from when settings.py was generated*].
(The Permission model in django.contrib.auth depends on
django.contrib.contenttypes.) Run the command manage.py syncdb. Note that
the default settings.py file created by django-admin.py startproject
includes 'django.contrib.auth' and 'django.contrib.contenttypes' in
INSTALLED_APPS for convenience. If your INSTALLED_APPS already contains
these apps, feel free to run manage.py syncdb again; you can run that
command as many times as you’d like, and each time it’ll only install
what’s needed.

"The syncdb command creates the necessary database tables, creates
permission objects for all installed apps that need ‘em, and prompts you to
create a superuser account the first time you run it.

"Once you’ve taken those steps, that’s it."

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.

I am running Django 1.2.1. How can I glue things together so a
@login_required decorator finds a logged-in user, and I can build on top of
that?

-- 
[image: Christos Jonathan Hayward] <http://jonathanscorner.com/>
Christos Jonathan Hayward, an Orthodox Christian author.

*Amazon <http://amazon.com/author/cjshayward>* • Author
Bio<http://jonathanscorner.com/author/>
 • *Email <christos.jonathan.hayw...@gmail.com>* •
Facebook<http://www.facebook.com/christos.jonathan.hayward>
 • Google Plus <http://jonathanscorner.com/plus> •
*Kindle<http://stornge.com/amazon>
* • LinkedIn <http://www.linkedin.com/in/jonathanhayward> •
*Professional<http://JonathanHayward.com>
* • Twitter <http://twitter.com/JonathansCorner> •
*Web<http://jonathanscorner.com/>
* • What's New? <http://jonathanscorner.com/>
I invite you to visit my "theology, literature, and other creative works"
site. *See one page of my website! <http://random.jonathanscorner.com/>*

-- 
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