Saturday 15 June 2013

Django Userena Customization -


I recently installed Django Userena on my Linux Apache server.

After fixing some errors, I started looking through the documentation. However, after searching for documents and many Google searches, I still do not know how the presence of pages could change! For example, how do I change the appearance of signin pages, signup pages, etc.? I know that each userena template is expanded to base.html , but where do I go from there?

I'm probably missing something very simple, so please forgive me, so the answer to this question is very much. itemprop = "text">

This is sign-in Userena () signature method -

  DEF sign-in (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 space. You can override it.

  URL (r '^ signin /', 'userena.views.signin', {'TEMPLATE_NAME' - in your  urls.py , you use it like this You can create  signin.html  inside your  templates: 'signin.html'}, name = "sign in"),   

Extend page folder and base.html . Returns the signin view login form in a variable named form . You can see. You can use the form on your template signin.html on {{form.as_p}} . If you can follow userena.forms, you can also format each field individually AuthenticationForm . Again, check that you can do the same for any scene. The user has given permission to impose this way.

When there is a doubt, read the source code. :)

No comments:

Post a Comment