Skip to content
Lou Markovski edited this page Jan 7, 2016 · 3 revisions

jwt-auth uses a Python Django app to demonstrate the capabilities of JSON Web Tokens (JWT).

Get the code:

$ git clone https://github.com/loum/jwt-auth.git

Build the virtual environment and download project dependencies:

$ cd jwt-auth
$ make init

Run the tests to make sure all is OK:

$ source venv/bin/activate
(venv) $ make test

Preparing the JWT-Auth Environment

The tests allow for a self-contained execution of the JWT environment but you may want to execute individual components separately from the command line or via your browser. These steps detail the steps required to prepare the JWT-Auth project environment.

First, start with a pristine environment:

$ make clean

Source the virtual environment and prepare:

$ source venv/bin/activate

Apply the migrations for first time use and create the Django admin user (make note of the username and password):

$ python manage.py migrate 
$ python manage.py createsuperuser

This will allow you start the test server:

$ python manage.py runserver 0.0.0.0:8000

... and navigate to the Django Admin page login:

http://<your_server_ip>:8000/admin/