I assume you are saving your user data into a
django.contrib.auth.models.User object?
I recommend using django's authentication framework,
http://docs.djangoproject.com/en/dev/topics/auth/ with all its
predefined views for logging in, etc, you will just need to provide
the html pages.
Now, if you want a custom login page, you will need the following:
* login url in urls.py
* login view for handling authentication
And your view can have something like this:
def user_login(request):
try:
# you might want to get user and pass from an html POST
# authenticate here using django.contrib's authentication
functions
from django.contrib.auth import authenticate, login
user = authenticate(username=user,password=pass)
if user is not None:
login(request,user)
# redirect to success.html
except MyUser.DoesNotExist:
pass
# render the login page
For more info,
http://docs.djangoproject.com/en/dev/topics/auth/#authentication-in-web-requests