Reference Project

For convenience, we provide a reference project which implements all of the conventional user-flows for sign up, sign in and account management. Feel free to use this project to guide your implementation of django_flex_user.

You can try a live version of the reference project here. Or, you can run the reference project on your local machine.

Running the reference project locally

  1. Clone the git repository:

    $ mkdir django-flex-user
    $ cd django-flex-user
    $ git clone https://github.com/ebenh/django-flex-user
    
  2. Create an .env file with the following contents:

    DEBUG=1
    SECRET_KEY=NOT_FOR_PRODUCTION_x-)pi_7=*sqrnqeo!!p*986207*n4-!4xa&hd(lq&@@p0m=4*(
    SENDGRID_API_KEY=...
    SOCIAL_AUTH_FACEBOOK_KEY=...
    SOCIAL_AUTH_FACEBOOK_SECRET=...
    SOCIAL_AUTH_GOOGLE_OAUTH2_KEY=...
    SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET=...
    

    Note

    Replace ellipses with the values you obtain by following the instructions below:

    • For Sendgrid, click here to obtain an API key.

    • For Facebook Login, click here to obtain an “App ID” and “Secret Key”.

    • For Google Sign-In, click here to obtain an “OAuth Client ID” and “Client Secret”.

  3. Install dependencies:

    $ python -m pipenv install --dev
    

    Note

    On Windows, the command to execute Python is py.

  4. Activate the pipenv shell:

    $ python -m pipenv shell
    
  5. Initialize database tables:

    $ python manage.py migrate
    
  6. Create a super user:

    $ python manage.py createsuperuser
    
  7. Run the development server:

    $ python manage.py runserver
    
  8. Run tests:

    $ python manage.py test
    
  9. Build the Python package:

    $ python setup.py sdist
    
  10. Build the docs:

    $ cd doc
    $ sphinx-apidoc -o source ../django_flex_user ../django_flex_user/tests ../django_flex_user/migrations
    $ make html
    

    Note

    If you’re running Git Bash on Windows, the last command should be ./make.bat html