Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fylein/fyle-rest-auth
Django application to implement OAuth 2.0 using Fyle in Django rest framework
https://github.com/fylein/fyle-rest-auth
team-integrations
Last synced: about 2 hours ago
JSON representation
Django application to implement OAuth 2.0 using Fyle in Django rest framework
- Host: GitHub
- URL: https://github.com/fylein/fyle-rest-auth
- Owner: fylein
- License: mit
- Created: 2020-01-16T07:28:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-16T09:36:26.000Z (3 months ago)
- Last Synced: 2025-01-01T12:39:13.651Z (5 days ago)
- Topics: team-integrations
- Language: Python
- Size: 61.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fyle Rest Auth
Django application to implement OAuth 2.0 using Fyle in Django rest framework
## Installation
This project requires [Python 3+](https://www.python.org/downloads/) and [Requests](https://pypi.org/project/requests/) library (pip install requests).
1. Download this project and use it (copy it in your project, etc).
2. Install it from [pip](https://pypi.org).
$ 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
```pythonstub
INSTALLED_APPS = [
...,
'fyle_rest_auth'
]
```* Add authentication class to settings file
```pythonstub
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'fyle_rest_auth.authentication.FyleJWTAuthentication',
),
}
```* Add serializer path in settings file
```pythonstub
FYLE_REST_AUTH_SERIALIZERS = {
'USER_DETAILS_SERIALIZER': 'users.serializers.UserSerializer'
}
```* Add the constants in settings file
```pythonstub
FYLE_BASE_URL = ''
FYLE_TOKEN_URI = ''
FYLE_CLIENT_ID = ''
FYLE_CLIENT_SECRET = ''
```* Include urls in the the django app.
```pythonstub
urlpatterns = [
path('api/admin/', admin.site.urls),
path('api/auth/', include('fyle_rest_auth.urls')),
]
```
* Configure cache in settings file
```pythonstub
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
'LOCATION': 'your_cache_table',
}
}
```* Creating the cache table
```pythonstub
python manage.py createcachetable
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details