yourcelf / django-registration-defaults

Default implementations of the 15 templates required to do full login, logout, registration and password retrieval when using django-registration.
277 stars 77 forks source link

Please add registration_closed.html #17

Open olberger opened 10 years ago

olberger commented 10 years ago

Django-registration allows setting REGISTRATION_OPEN to False, in which case a registration_closed.html template would be displayed.

It would be great to include it also, for completeness.

Thanks in advance.

cljohnson commented 10 years ago

For others who may view this issue, I found the ACCOUNT_ACTIVATION_DAYS in /path/to/your/project/application/registration_defaults.py.

Also there is the appropriate statement for including the template path i.e. REGISTRATION_TEMPLATE_DIR = os.path.join(os.path.dirname(file), "templates")

You will see that author yourcelf set the ACCOUNT_ACTIVATION_DAYS to 2, as opposed to the django-registration default value of 7.

It's easy enough to add REGISTRATION_OPEN = (either True or False) to the same file.

These are the only configurable default values. See: https://django-registration.readthedocs.org/en/latest/default-backend.html

This backend makes use of the following settings:

ACCOUNT_ACTIVATION_DAYS This is the number of days users will have to activate their accounts after registering. Failing to activate during that period will leave the account inactive (and possibly subject to deletion). This setting is required, and must be an integer. REGISTRATION_OPEN A boolean (either True or False) indicating whether registration of new accounts is currently permitted. This setting is optional, and a default of True will be assumed if it is not supplied.

I hope this helps you or others. I initially stuck the same stuff found in settings.py in other project settings files. Once I saw what author yourcelf did, I reverted my code and simply relied on this file.

Cheers.

Thanks to yourcelf for sharing his work.