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?
Override Django-AllAuth Template Forms (Login/Signup) Instead of writing your own templates, just copy-paste the allauth templates in your project directory templates and edit them as you want. Copy all the files/directories from allauth templates.
Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
To configure the Django template system, go to the settings.py file and update the DIRS to the path of the templates folder. Generally, the templates folder is created and kept in the sample directory where manage.py lives. This templates folder contains all the templates you will create in different Django Apps.
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.
the latest version of all-auth on github has its templates outside, however the one on Pypi is not, all you need to do is clone the repo in your project directory and override the templates. As simple as that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With