initial commit
This commit is contained in:
6
config/conf/__init__.py
Normal file
6
config/conf/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from .rest_framework import *
|
||||
from .cors import *
|
||||
from .jwt import *
|
||||
from .logs import *
|
||||
from .swagger import *
|
||||
from .redis import *
|
||||
9
config/conf/cors.py
Normal file
9
config/conf/cors.py
Normal file
@@ -0,0 +1,9 @@
|
||||
CORS_ALLOWED_ORIGINS = [
|
||||
"http://localhost:5173",
|
||||
"http://127.0.0.1:5173",
|
||||
]
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [
|
||||
'http://localhost:8001',
|
||||
'http://127.0.0.1:8001',
|
||||
]
|
||||
10
config/conf/jwt.py
Normal file
10
config/conf/jwt.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from datetime import timedelta
|
||||
|
||||
|
||||
SIMPLE_JWT = {
|
||||
"ACCESS_TOKEN_LIFETIME": timedelta(days=30),
|
||||
"REFRESH_TOKEN_LIFETIME": timedelta(days=365),
|
||||
"ROTATE_REFRESH_TOKENS": True,
|
||||
"BLACKLIST_AFTER_ROTATION": True,
|
||||
"UPDATE_LAST_LOGIN": True,
|
||||
}
|
||||
0
config/conf/logs.py
Normal file
0
config/conf/logs.py
Normal file
24
config/conf/redis.py
Normal file
24
config/conf/redis.py
Normal file
@@ -0,0 +1,24 @@
|
||||
CACHES = {
|
||||
"default": {
|
||||
"BACKEND": 'django_redis.cache.RedisCache',
|
||||
"LOCATION": 'redis://redis:6379',
|
||||
"TIMEOUT": 300,
|
||||
},
|
||||
}
|
||||
|
||||
CACHE_MIDDLEWARE_SECONDS = 300
|
||||
|
||||
|
||||
CACHEOPS_REDIS = 'redis://redis:6379'
|
||||
CACHEOPS_DEFAULTS = {
|
||||
"timeout": 300,
|
||||
}
|
||||
|
||||
CACHEOPS = {
|
||||
"accounts.*": {
|
||||
"ops": "all",
|
||||
"timeout": 60 * 5,
|
||||
},
|
||||
}
|
||||
CACHEOPS_DEGRADE_ON_FAILURE = True
|
||||
CACHEOPS_ENABLED = False
|
||||
9
config/conf/rest_framework.py
Normal file
9
config/conf/rest_framework.py
Normal file
@@ -0,0 +1,9 @@
|
||||
REST_FRAMEWORK = {
|
||||
"DEFAULT_AUTHENTICATION_CLASSES": [
|
||||
'rest_framework.authentication.SessionAuthentication',
|
||||
'rest_framework.authentication.BasicAuthentication',
|
||||
'rest_framework_simplejwt.authentication.JWTAuthentication',
|
||||
],
|
||||
# 'DEFAULT_PAGINATION_CLASS': 'core.apps.shared.paginations.custom.CustomPageNumberPagination',
|
||||
# 'PAGE_SIZE': 10
|
||||
}
|
||||
13
config/conf/swagger.py
Normal file
13
config/conf/swagger.py
Normal file
@@ -0,0 +1,13 @@
|
||||
SWAGGER_SETTINGS = {
|
||||
'SECURITY_DEFINITIONS': {
|
||||
'Basic': {
|
||||
'type': 'basic'
|
||||
},
|
||||
'Bearer': {
|
||||
'type': 'apiKey',
|
||||
'name': 'Authorization',
|
||||
'in': 'header'
|
||||
}
|
||||
},
|
||||
"USE_SESSION_AUTH": False
|
||||
}
|
||||
Reference in New Issue
Block a user