Small app to use django-allauth with bootstrap forms.
We simply override the as_p
method of all allauth forms, so we din't had to change templates or anything else.
Therefore we used our django-forms-bs which simply adds an
as_bootstrap()
method to django standard forms.
pip install git+https://github.com/InQuant/django-allauth-bs
- add
allauth-bs
below toallauth
inINSTALLED_APPS
settings. - Set allauth form settings to
ACCOUNT_FORMS = { 'login': 'allauth_bs.forms.BSLoginForm', 'signup': 'allauth_bs.forms.BSSignupForm', 'add_email': 'allauth_bs.forms.BSAddEmailForm', 'change_password': 'allauth_bs.forms.BSChangePasswordForm', 'set_password': 'allauth_bs.forms.BSSetPasswordForm', 'reset_password': 'allauth_bs.forms.BSResetPasswordForm', 'reset_password_from_key': 'allauth_bs.forms.BSResetPasswordKeyForm', 'disconnect': 'allauth_bs.forms.BSDisconnectForm', }
- Extend your scss e.g. with:
button, input[type=submit] { @extend .btn, .btn-primary; }
- Put a
account/base.html
which provides acontent
block below your apps template dir, e.g.:{# extend e.g. your own base.html menu and footer #} {% extends "base.html" %} {% block main %} <div class="container"> {% block content %}{% endblock %} </div> {% endblock main %}