Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Added 'How to log a user in' section to docs/authetication.txt

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5c0380b6ede3b8e1d18e8abe40451ba9632202bf 1 parent e0c915e
@adrianholovaty adrianholovaty authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 docs/authentication.txt
15 docs/authentication.txt
@@ -228,6 +228,21 @@ information.
.. _request objects:
.. _session documentation:
+How to log a user in
+To log a user in, do the following within a view::
+ from django.models.auth import users
+ request.session[users.SESSION_KEY] =
+Because this uses sessions, you'll need to make sure you have
+``SessionMiddleware`` enabled. See the `session documentation`_ for more
+This assumes ``some_user`` is your ``User`` instance. Depending on your task,
+you'll probably want to make sure to validate the user's username and password.
Limiting access to logged-in users

0 comments on commit 5c0380b

Please sign in to comment.
Something went wrong with that request. Please try again.