django-registration-defaults

Default implementations of the 15 templates required to do full login, logout, registration and passwor...
Download

django-registration-defaults Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Publisher Name:
  • Charlie DeTar
  • Publisher web site:
  • http://olwidget.org

django-registration-defaults Tags


django-registration-defaults Description

Default implementations of the 15 templates required to do full login, logout, registration and password retrieval when using django-registration James Bennet's django-registration is awesome. But it doesn't come with any of the 15 templates required to implement the workflow of registration, login/logout, and password changing and resetting. This application simply provides a set of default templates for this to avoid the repetition of rewriting them.django-registration-defaults is a Django app, a supplemental to django-registration, which must also be installed.InstallationInstall using your preferred method for python modules. The folder registration_defaults must end up in your python path. You could do this by copying or symlinking the folder into your path, or with:python setup.py installMy preferred method (and that of many django developers) is to install from the git source using pip with virtualenv. The requirements file entry for this (and the dependency django-registration) is as follows:django-registration-e git://github.com/yourcelf/django-registration-defaults.git#egg=django-registration-defaultsSetupConfiguration parameters required by django-registration are set in the module registration_defaults.settings. Add these by importing them into your settings file:from registration_defaults.settings import *You can add the templates in one of two ways: If you're using the django.template.loaders.app_directories.Loader template loader (it is enabled by default), you can include the templates by adding "registration_defaults" to your project's INSTALLED_APPS setting. Keep in mind that admin defines some templates for changing and retrieving passwords, so if you want to use consistent base templates and styling for all registration and login/logout functions, you should add registration_defaults before django.contrib.admin so that it will take precedence: INSTALLED_APPS = ( ... "registration_defaults", "django.contrib.admin", ... "registration", ) Alternatively, if django.template.loaders.filesystem.Loader is listed before the app directories loader, you can add REGISTRATION_TEMPLATE_DIR to your TEMPLATE_DIRS setting. If you do this, it is not necessary to include registration_defaults as an installed app: from registration_defaults.settings import * TEMPLATE_DIRS = ( ... REGISTRATION_TEMPLATE_DIR, )Base templatesAll registration_defaults templates inherit from registration/registration_base.html. The default template provided for this is simply:{% extends "base.html" %}You must either provide a base.html for the registration templates to inherit from, or override registration/registration_base.html. The base template should provide a title block for the content of the HTML title, and a content block for content (NOTE: this has changed from previously using body to be more in line with reusable app standards ). For example:< !doctype html >< html > < head > < title >{% block title %}{% endblock %}< /title > < /head > < body > {% block content %}{% endblock %} < /body >< /html >Bugs, improvementsPlease contribute any improvements or bugs to the github project page Requirements: · Python · Django · django-registration


django-registration-defaults Related Software