8π
This is the signin
method signature for Userena(source) β
def signin(request, auth_form=AuthenticationForm,
template_name='userena/signin_form.html',
redirect_field_name=REDIRECT_FIELD_NAME,
redirect_signin_function=signin_redirect, extra_context=None):
As you can see, there is a template_name
method that holds the template location. You can override this. In your urls.py
, you can use it like β
url(r'^signin/', 'userena.views.signin', {'template_name': 'signin.html'}, name="signin"),
You can then create the signin.html
page inside your templates
folder and extend base.html
. The signin
view sends the login form in a variable called form
. You can see the source. You can use the form on your template signin.html
like {{ form.as_p }}
. You can also format each field individually if you can follow the userena.forms. AuthenticationForm
. Again, check the source code. You can do the same for any view Userena has that allows overriding like this.
When in doubt, read the source code. π
4π
You need to override userena
default templates
.
Create a directory inside your templates/
named userena/
, Then for example if you want to change signup
form, easily create signup_form.html
template file inside that userena/
dir that youβve just created and start writing.
For instance here is default signup_form.html
template.
You can find userena default templates at its github repo
- [Django]-Virtualenv, sys.path and site-packages
- [Django]-How to import django models in scrapy pipelines.py file
1π
Just copy the supplied userena templates in your template directory.
You can find them on a linux box with find / -name userena
The path you are looking for is ../userena/templates/userena
. Copy the userena folder into your template directory and start changing the signin_form.html
.
- [Django]-Django autocomplete_fields doesn't work in TabularInline (but works in StackedInline)
- [Django]-PHP and Django: Nginx, FastCGI and Green Unicorn?
- [Django]-Django Channels 2.0: call Consumer's channel by its name
0π
Just copy the templates to your own template directory. If you follow this link download and just copy the directory βuserenaβ to your template directory. You can then customise the templates including the email text and templates.
- [Django]-Django all-auth Form errors not displaying
- [Django]-Django Social Auth w/ Twitter: HTTP 401 Error (Unauthorized)