Generating Login and Registration Forms with Contrib.Auth in Django

I'm new to Django and in bouncing around the framework over the past few days I haven't been able to figure out how to properly install the django.contrib.auth app in my project. Well, installing is probably not the right word, but configuring it for my purposes.

What I'm truly hoping to do is extend the built-in classes to simply create registration and login forms, since my User class is working just fine from terminal.

In settings.py I have django.contrib.auth in my INSTALLED_APPS. I also have installed the Authentication Middleware and Sessions Middleware.

I can also clearly see in Django.contrib.auth.views and Django.contrib.auth.forms where the registration and authentication handlers are.

My problem, it seems, since I'm new to the framework, is properly including these files in my project and generating the HTML forms for registration and login.

(As in, do I need to include these Auth files in my app's forms.py? What do I need to model that hasn't already been modeled for me? And finally, since I can see in Django.contrib.auth.views a need for a registration directory with HTML templates, how can I get these all communicating with each other properly?)

Figured out the problem. Just needed to follow Django's URL Conf conventions. Example: (r'^accounts/login/$', 'django.contrib.auth.views.login'),

Answers


James Bennet's django-registration is an excellent helper application used for a common registration / login pattern.


Need Your Help

Qt Creator I can't change/find the sizeHint in the widget property panel

c++ qt qt-creator

I'm using custom compiled Qt libraries version 4.8.5 with MinGW GCC 4.8.2 along with Qt Creator 3.0.1 and I'm trying to set the sizeHint of two Tab Widgets inside a Horizontal Splitter under the Ce...

Open and control new window in KRL/Kynetx

krl

I want to open a new window by clicking on a button (which is injected via Kynetx), but I want this new window to run in the Kynetx sandbox enviornment. This is because the new window will have a b...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.