Skip to content

Instantly share code, notes, and snippets.

@aballah-chamakh
Last active December 10, 2019 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aballah-chamakh/4c929928aef5140528dbeb1be8faae41 to your computer and use it in GitHub Desktop.
Save aballah-chamakh/4c929928aef5140528dbeb1be8faae41 to your computer and use it in GitHub Desktop.
# ...
# installed app
INSTALLED_APPS = [
# ...
'rest_framework',
'corsheaders',
'SAInference',
]
# ...
CORS_ORIGIN_ALLOW_ALL = True
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
# ...
]
# JWT configuration
from datetime import timedelta
JWT_AUTH = {
'JWT_AUTH_HEADER_PREFIX': 'Bearer',
'JWT_EXPIRATION_DELTA': timedelta(days=10000),
}
# DRF configuration
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment