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')),
]
- Configure cache in settings file
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'your_cache_table',
}
}
- Creating the cache table
python manage.py createcachetable
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
Built Distribution
File details
Details for the file fyle_rest_auth-1.7.4.tar.gz
.
File metadata
- Download URL: fyle_rest_auth-1.7.4.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 469e1e4621e3baeaded1353588cc91c733ae785de778b5e7c7c86125031a01e8 |
|
MD5 | 706689017e07835d77c0030d860056a6 |
|
BLAKE2b-256 | 45819a06af515b43d0991b03abc855229569fcc32d24e1eaf610e7d7ae482e34 |
File details
Details for the file fyle_rest_auth-1.7.4-py3-none-any.whl
.
File metadata
- Download URL: fyle_rest_auth-1.7.4-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480558d637c82701f911107398807ea162d4f851eb21b6e687b09b8c69911dc2 |
|
MD5 | 724abf87374c47bbe19bac3ea640446d |
|
BLAKE2b-256 | 8fd285a2080409e2731d688c301945c264c76fb6bf88b50050d34605c4e2c2ba |