connection pool
This commit is contained in:
parent
63a6da058e
commit
c966dd3171
1 changed files with 7 additions and 16 deletions
|
|
@ -16,7 +16,6 @@ from decouple import config
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
||||||
|
|
||||||
|
|
@ -55,7 +54,7 @@ INSTALLED_APPS = [
|
||||||
'apps.core',
|
'apps.core',
|
||||||
'apps.users',
|
'apps.users',
|
||||||
'apps.gooyal_oauth2',
|
'apps.gooyal_oauth2',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
|
@ -121,7 +120,7 @@ REST_FRAMEWORK = {
|
||||||
# ],
|
# ],
|
||||||
'DEFAULT_THROTTLE_RATES': {
|
'DEFAULT_THROTTLE_RATES': {
|
||||||
'otp_min': '2/min',
|
'otp_min': '2/min',
|
||||||
'otp_day': '50/day',
|
'otp_day': '200/day',
|
||||||
},
|
},
|
||||||
'EXCEPTION_HANDLER': 'utils.exceptions.exception_handler',
|
'EXCEPTION_HANDLER': 'utils.exceptions.exception_handler',
|
||||||
}
|
}
|
||||||
|
|
@ -135,7 +134,6 @@ SPECTACULAR_SETTINGS = {
|
||||||
"PARSER_WHITELIST": ["rest_framework.parsers.JSONParser"],
|
"PARSER_WHITELIST": ["rest_framework.parsers.JSONParser"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ROOT_URLCONF = 'accounts.urls'
|
ROOT_URLCONF = 'accounts.urls'
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
|
|
@ -180,7 +178,10 @@ DATABASES = {
|
||||||
'PASSWORD': config('DB_PASSWORD'),
|
'PASSWORD': config('DB_PASSWORD'),
|
||||||
'HOST': config('DB_HOST', '127.0.0.1'),
|
'HOST': config('DB_HOST', '127.0.0.1'),
|
||||||
'PORT': config('DB_PORT', ''),
|
'PORT': config('DB_PORT', ''),
|
||||||
}
|
},
|
||||||
|
"OPTIONS": {
|
||||||
|
"pool": True,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
|
|
@ -201,7 +202,6 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
||||||
|
|
||||||
|
|
@ -219,7 +219,6 @@ LOCALE_PATHS = [
|
||||||
BASE_DIR / 'locale',
|
BASE_DIR / 'locale',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
||||||
|
|
||||||
|
|
@ -229,23 +228,18 @@ MEDIA_ROOT = BASE_DIR / 'media'
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
|
|
||||||
if DEBUG == True:
|
if DEBUG == True:
|
||||||
STATICFILES_DIRS = (
|
STATICFILES_DIRS = (
|
||||||
BASE_DIR / 'static',
|
BASE_DIR / 'static',
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
STATIC_ROOT = BASE_DIR / 'static'
|
STATIC_ROOT = BASE_DIR / 'static'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LOGIN_URL = '/users/login/'
|
LOGIN_URL = '/users/login/'
|
||||||
# LOGIN_DEFAULT_REDIRECT_URL = '/'
|
# LOGIN_DEFAULT_REDIRECT_URL = '/'
|
||||||
|
|
||||||
|
|
@ -271,7 +265,6 @@ PAYAM_SMS_CLIENT_ID = config('PAYAM_SMS_CLIENT_ID')
|
||||||
PAYAM_SMS_CLIENT_SECRET = config('PAYAM_SMS_CLIENT_SECRET')
|
PAYAM_SMS_CLIENT_SECRET = config('PAYAM_SMS_CLIENT_SECRET')
|
||||||
SMS_OTP_SIGNITURE = config('SMS_OTP_SIGNITURE', '')
|
SMS_OTP_SIGNITURE = config('SMS_OTP_SIGNITURE', '')
|
||||||
|
|
||||||
|
|
||||||
CACHES = {
|
CACHES = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "django_redis.cache.RedisCache",
|
"BACKEND": "django_redis.cache.RedisCache",
|
||||||
|
|
@ -284,7 +277,6 @@ CACHES = {
|
||||||
|
|
||||||
LOKI_BASE_PUBLIC_URL = config('LOKI_BASE_PUBLIC_URL', default=None, cast=str)
|
LOKI_BASE_PUBLIC_URL = config('LOKI_BASE_PUBLIC_URL', default=None, cast=str)
|
||||||
|
|
||||||
|
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'disable_existing_loggers': False,
|
'disable_existing_loggers': False,
|
||||||
|
|
@ -320,7 +312,6 @@ LOGGING = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue