This is an example settings.py
to get an OAUTH2
flow working with python
django
and swagger
.
This has been tested on Django 2.0
Follow basic setup instructions from:
https://github.com/evonove/django-oauth-toolkit
and
https://github.com/axnsan12/drf-yasg
Then use the settings.py
file as an example to follow off of.
Ensure your application
is set to something like:
Client type: confidential
Authorization Grant Type: authorization-code
Redirect Uris: 'http://localhost/static/drf-yasg/swagger-ui-dist/oauth2-redirect.html'
This example uses the accessCode
flow.
SWAGGER_SETTINGS
References:
OAUTH2 redirect url
reference
(note the static path)