django-rest-framework-oauth2-provider-example
django-rest-framework-oauth2-provider-example copied to clipboard
Working example of django-rest-framework using OAuth2Authentication (django-oauth2-provider) and SessionAuthentication.
django-rest-framework-oauth2-provider
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.
Requirements
- You should have virtualenv installed.
- Make sure your SSH keys are set up properly for GitHub.
Install
Clone this repo, set up and activate a virtualenv:
git clone [email protected]: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
Run the server
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.
Tests
make test