Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

djdg OAuth2 method for Django

Project description

# django-oauth

Description
--------
Djdg Django Oauth provides a simple signature middleware verification between apps

Support
-------
mail to zane.yang@hey900.com

Requirements
------------

* Python 2.7
* Django 1.9

Installation
------------

**Install with pip**

pip install djdg-django-oauth

**Add `djdg_oauth` to your `INSTALLED_APPS`**


INSTALLED_APPS = (
...
'djdg_oauth',
)

**run migrate to add tables:**


python manage.py migrate djdg_oauth


**list, add, del app secret:**

python manage.py listauthapp {app_name}
python manage.py addauthapp {app_name}
python manage.py delauthapp {app_name}

**add middleware**(**options**, *you can create yourself middleware with djdg_oauth.oauthclient.OauthClient.verify_request*):

MIDDLEWARE_CLASSES = (
...
'djdg_oauth.middleware.DjdgAuthMiddleware',
)

**add settings**(*app secret gaved by others*)

DJDG_AUTH = {
"APPS": [
{"appid": "xxxxxx", "secret": "xxxxxxxxxxxxxxxxxxx", "app": "xxx"},
....
]
"FULL_ESCAPE_URL": [....] # full match url to escape auth check,
"REGEX_ESCAPE_URL": [....] # regex match url to escape auth check,
"REGEX_CHECK_URL":[...] # need check url, if not empty, escape urls invalid
}
)

Documentation
--------------

**Verify request**

from djdg_oauth.oauthclient import OauthClient
auth = OauthClient()
auth.verify(request)

**Do request**

from djdg_oauth.oauthclient import OauthClient
request_data = {
"url": #url,
"app": #app type,
"parameters": #all request data,
"method": #request method,
"headers": #default None
}
OauthClient.oauth_request(**request_data)


License
-------

djdg-oauth is released under the terms of the **BSD license**. Full details in ``LICENSE`` file.

Changelog
---------

version 0.0.20

debug ascii error


Project details


Release history Release notifications

This version
History Node

1.0.1

History Node

1.0.0

History Node

0.0.22

History Node

0.0.21

History Node

0.0.20

History Node

0.0.19

History Node

0.0.18

History Node

0.0.17

History Node

0.0.16

History Node

0.0.15

History Node

0.0.14

History Node

0.0.13

History Node

0.0.12

History Node

0.0.11

History Node

0.0.10

History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
djdg-django-oauth-1.0.1.tar.gz (8.5 kB) Copy SHA256 hash SHA256 Source None Aug 14, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page