1. Henry Ward
  2. django-piston-nonrel-oauth2


I created this sample installation because I needed to create django REST service with piston on mongodb and oauth2 authentication.  I found it there were a number of bugs in piston, issues with django-nonrel, and few good examples of oauth2 authentication.  I spent a couple of days figuring this out.  Hopefully this will save you the time!

This an example installation of fully functional django-nonrel piston installation with oauth2 authentication and GET and POST examples for a basic Poll application.

These are the installation instructions to get your django-piston-nonrel-oauth2 server up and running.

1.  Clone repository at 

2.  virtualenv piston-env

3.  source ./piston-env/bin/activate

4.  pip install requirements.txt

5.  Update your settings.py to point to your mongodb settings

6.  Run ./manage.py syncedb and create your superuser account

7.  Run ./manage.py runserver

8.  Go to localhost:8000/admin and login. Create a Consumer with the following settings:

Consumer Key: testkey
Consumer Secret: testsecret

The name and description can be anything you choose.  Attach the Consumer to your superuser or another use if you have created on.

9.  From a command line prompt run python oauth_client.py

10.  Follow the instructions for oauth_client.py

Hope this helps!