Registration for Django Rest Framework
Switch branches/tags
Nothing to show
Clone or download
Latest commit 485be6b Oct 8, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
registration_api Updated tests for fixes by @tak3r Oct 8, 2014
tests
.gitignore Updated .gitignore Oct 7, 2014
COPYING First commit. Added user creation endpoint. Dec 13, 2013
README.rst Improved workflow on readme Oct 8, 2014
setup.py

README.rst

Django Registration Rest Framework

Clone of Django Resgistration flow for Django Rest Framework

Based on

StackOverflow answer http://stackoverflow.com/a/19337404

and

django-registration https://django-registration.readthedocs.org/

Install

$ git clone git@github.com:tucarga/django-registration-rest-framework.git

$ pip install -e django-registration-rest-framework

Usage

settings.py

INSTALLED_APPS =
...
'registration_api',
...

# This setting is mandatory
REGISTRATION_API_ACTIVATION_SUCCESS_URL = '/'

urls.py

urlpatterns = patterns(
...
url(r'^accounts_api/', include('registration_api.urls')),
...
)

Front-end

From your front-end or mobile application send a post to the register url 'accounts_api/register/'. The fields depends on your AUTH_USER_MODEL but should be something like

[{"username": "john", "email": "john@example.com", "password": "verylongpassword"}]

This will trigger an email to the addess specified by the user. When the user follows the link the account is activated.

Test

$ python tests/runtests.py [TestsCase[.test_method]]

or

$ python setup.py test