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.3.tar.gz
.
File metadata
- Download URL: fyle_rest_auth-1.7.3.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 | bc7686a94080acb7376ad8362dfee19a5788fb9e0651652a5dca5e101501dd78 |
|
MD5 | 0a14128455c502cd034d18646232991e |
|
BLAKE2b-256 | d22dbb5348a14294729c205c8811f434729bdea3b658ae664c1e7ccb5070dfda |
File details
Details for the file fyle_rest_auth-1.7.3-py3-none-any.whl
.
File metadata
- Download URL: fyle_rest_auth-1.7.3-py3-none-any.whl
- Upload date:
- Size: 12.3 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 | bd882c1d56667bd7a7448e34edc37b2829fb066002283db9cfd21b56c85318dc |
|
MD5 | 53ea12b2c0d1023b30c009e19d92c4c6 |
|
BLAKE2b-256 | 11a4366cb9ba9c4224e05d70de440412bd161206edd25bbb4abafe1a9e26a19f |