overriding default templates of django-allauth

user993563 picture user993563 · Feb 24, 2012 · Viewed 17.5k times · Source

I used this social registration/signup library django allauth for a project of mine. How do i customize the default templates and forms to give a better look and feel?

Answer

Chris Lawlor picture Chris Lawlor · Mar 5, 2012

Assuming you have set a project level templates directory using the TEMPLATE_DIRS setting like:

TEMPLATE_DIRS = [
    os.path.join(PROJECT_DIR, 'templates'),
]

You should be able to copy all of the folders shown here into that directory and edit them as you need. Most of the templates seem to be filling a {% block content %} block, so it's probably easiest if your site_base.html template defines that block somewhere.

If you haven't set TEMPLATE_DIRS, you can do the same thing, but copy the template folders into the templates directory of one of your apps. I prefer to set TEMPLATE_DIRS and keep the main site templates like base.html there, since they don't really belong to a particular app, but that's really just a preference; the template loader should find them either way.