User Authentication Pages

Some sites require user accounts. This can be useful for when you want to restrict access to certain content. Glass doesn’t display any of these pages by default, but there are only a few steps to take to expose some good default forms.

Expose default user auth forms

Add the following pages to your site. As long as your site has a templates/base.html file that contains a {% content %} tag, these pages will extend from that area. If your template structure is different from that, you’ll need to create a template for each of these pages. For now, we’ll assume that your template follows those defaults. Add these pages with the following URLs. Assign them to any template. (These are special URLs, and the ‘template’ value doesn’t matter here.)

  • login
  • register (This requires re:captcha integration. More on that below.)
  • forgot_password (This form sends an e-mail with the /reset_password link.)
  • reset_password (This form is sent by an admin to an e-mail address and requires a token that is only good for 24 hours.)

Customized templates for user auth forms

Follow a particular template pattern to completely customize your user auth templates. This is helpful when you want to pass certain permissions or user groups every time a person registers for a site. You can also put custom instructions on these pages, and even add admin-editable fields above or below the forms. To use custom templates, create the same pages as above after you’ve added the following templates to your site:

  • templates/registration/login.html
  • templates/registration/register.html
  • templates/registration/forgot_password.html
  • templates/registration/reset_password.html

It’s easiest to start with the default forms and build on as necessary, but we’d rather not post the code here. [Contact us for a copy of these files]( and we’ll upload the defaults to your site for you.

Manage users with the Control Panel

Site administrators have the ability to add users, change permissions, or revoke access to site groups from within the control panel, here: