This is custom backend for django-registration.
Features of backend:
- requires invitation code to proceed,
- requires TOS (Terms of Service) accepted by user.
Invitation codes are useful for e.g. service beta testing. Also, since the invitation code backend is fully compatible with default backend, when your service is going public and you decide not to use invitation codes, all you need to do is disable the "invitation" backend.
Download the source code and run python setup.py install from the django-registration-invitecode-backend directory.
In settings.py INSTALLED_APPS section add 'invitation' after 'registration':
INSTALLED_APPS = ( 'registration', 'invitation', )
Modify your main, or application, urls.py to use the invitation app urls.py:
(r'^accounts/', include('invitation.urls'), ),
Run syncdb or south schemamigration if you use it:
./manage.py syncdb
Application created InvitationCode model for codes. Invitation codes can be anything you want (up to 256 chars) - here there are 5 random characters.
InvitationCode model also stores information about who and when used specific code so you can track it.
You can make invitation code as long as you want, up to 256 chars.
Sample code for generation:
import string import random def generate_random_string(): chars = string.letters + string.digits return "".join(random.sample(chars, 5))
Application provides translation for languages:
- Polish (pl)
To create new translation simply run:
django-admin.py makemessages -l <language_code>
- django-registration