Working example of django-rest-framework using OAuth2Authentication (django-oauth2-provider) and SessionAuthentication for browseable API. Cross-Origin Resource Sharing is also enabled via django-cors-headers.
Client side example for Ember.js available at ember-app-kit-simple-auth.
- You should have virtualenv installed.
- Make sure your SSH keys are set up properly for GitHub.
Clone this repo, set up and activate a virtualenv:
git clone git@github.com:erkarl/django-rest-framework-oauth2-provider-example.git
cd django-rest-framework-oauth2-provider-example
virtualenv env
source env/bin/activate
Setup dependencies:
make install
make server
Launch http://localhost:7000 in your browser.
Default username is ar
and pasword ar
with a preconfigured client already set up.
...in case you'd like to start fresh:
rm db.sqlite3
make initdb
...then head over to Django admin and create your first client.
make test