Django application to implement OAuth 2.0 using Fyle in Django rest framework
Project description
Fyle Rest Auth
Django application to implement OAuth 2.0 using Fyle in Django rest framework
Installation
This project requires Python 3+ and Requests library (pip install requests).
-
Download this project and use it (copy it in your project, etc).
-
Install it from pip.
$ pip install fyle-rest-auth
Usage
To use this Django app you'll need fyle credentials used for OAuth2 authentication: client ID, client secret and refresh token.
- Add fyle rest auth in INSTALLED_APPS in settings file
INSTALLED_APPS = [
...,
'fyle_rest_auth'
]
- Add authentication class to settings file
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'fyle_rest_auth.authentication.FyleJWTAuthentication',
),
}
- Add serializer path in settings file
FYLE_REST_AUTH_SERIALIZERS = {
'USER_DETAILS_SERIALIZER': 'users.serializers.UserSerializer'
}
- Add the constants in settings file
FYLE_BASE_URL = '<Fyle Base URL>'
FYLE_TOKEN_URI = '<Fyle Token URI>'
FYLE_CLIENT_ID = '<Fyle Client Id>'
FYLE_CLIENT_SECRET = '<Fyle Client Secret>'
- Include urls in the the django app.
urlpatterns = [
path('api/admin/', admin.site.urls),
path('api/auth/', include('fyle_rest_auth.urls')),
]
License
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fyle-rest-auth-0.2.0.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for fyle_rest_auth-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8d260457d41bc9f89e2ef090a125e9045dd607459d353387c479b9fe2dadb61 |
|
MD5 | 40d42b03e24f8a4e379b0fefe5c2a444 |
|
BLAKE2b-256 | b9498f804d5a06e24894aeddcd1b5afb806035e8fe1a67d856f20ab7d94c97e1 |