Integrating Django with Express Gateway
- Python 3 or later
- Django 2 or later
- Django Rest Framework 3.7 or later
- Requests 2.19 or later
Install with pip
$ pip install django_express_gatewayAdd express_gateway to your INSTALLED_APPS
INSTALLED_APPS = [
...
'express_gateway',
]Add authentication to DRF default authentication settings
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'express_gateway.authentications.AuthUserAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.BasicAuthentication',
),
...
}Finally add the configuration for Centralize Authentication System.
# Config data should get from environment variable
EXPRESS_GATEWAY = {
'URL': 'https://mycas-server.com',
'API_KEY': 'testingApiKey',
'ENDPOINTS': {
'register': '/auth/user/
'token': '/auth/token/',
}
}