throttle
This commit is contained in:
parent
9f284fbfff
commit
492d06b5ba
1 changed files with 18 additions and 11 deletions
|
|
@ -119,6 +119,11 @@ REST_FRAMEWORK = {
|
||||||
# 'DEFAULT_THROTTLE_CLASSES': [
|
# 'DEFAULT_THROTTLE_CLASSES': [
|
||||||
# 'rest_framework.throttling.AnonRateThrottle',
|
# 'rest_framework.throttling.AnonRateThrottle',
|
||||||
# ],
|
# ],
|
||||||
|
'DEFAULT_THROTTLE_CLASSES': [
|
||||||
|
'apps.gooyal_oauth2.throttling.TokenLimitThrottle',
|
||||||
|
# 'rest_framework.throttling.AnonRateThrottle',
|
||||||
|
# 'rest_framework.throttling.UserRateThrottle'
|
||||||
|
],
|
||||||
'DEFAULT_THROTTLE_RATES': {
|
'DEFAULT_THROTTLE_RATES': {
|
||||||
'otp_min': '2/min',
|
'otp_min': '2/min',
|
||||||
'otp_day': '200/day',
|
'otp_day': '200/day',
|
||||||
|
|
@ -225,7 +230,6 @@ LANGUAGES = [
|
||||||
('tr', _('Turkish')),
|
('tr', _('Turkish')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
LOCALE_PATHS = [
|
LOCALE_PATHS = [
|
||||||
BASE_DIR / 'locale',
|
BASE_DIR / 'locale',
|
||||||
]
|
]
|
||||||
|
|
@ -275,11 +279,9 @@ PAYAM_SMS_PASSWORD = config('PAYAM_SMS_PASSWORD')
|
||||||
PAYAM_SMS_CLIENT_ID = config('PAYAM_SMS_CLIENT_ID')
|
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', '')
|
||||||
SMS_SEND=config('SMS_SEND', True, cast=bool)
|
SMS_SEND = config('SMS_SEND', True, cast=bool)
|
||||||
TEST_PHONENUMBERS=config('TEST_PHONENUMBERS', [], cast=Csv(post_process=list))
|
TEST_PHONENUMBERS = config('TEST_PHONENUMBERS', [], cast=Csv(post_process=list))
|
||||||
|
|
||||||
|
|
||||||
CACHES = {
|
CACHES = {
|
||||||
"default": {
|
"default": {
|
||||||
|
|
@ -311,7 +313,8 @@ LOGGING = {
|
||||||
'url': f'{LOKI_BASE_PUBLIC_URL}/loki/api/v1/push', # Loki url. Defaults to localhost. Optional.
|
'url': f'{LOKI_BASE_PUBLIC_URL}/loki/api/v1/push', # Loki url. Defaults to localhost. Optional.
|
||||||
# 'auth': ("user", "password"), # Basic auth to authenticate with loki. Default is None (i.e. no auth). Optional
|
# 'auth': ("user", "password"), # Basic auth to authenticate with loki. Default is None (i.e. no auth). Optional
|
||||||
'tags': {"app": "accounts"}, # Tags / Labels to attach to the log. Optional, but strongly encoraged to use.
|
'tags': {"app": "accounts"}, # Tags / Labels to attach to the log. Optional, but strongly encoraged to use.
|
||||||
'mode': 'thread', # Push mode. Can be 'sync' or 'thread'. Sync is blocking, thread is non-blocking. Defaults to sync. Optional.
|
'mode': 'thread',
|
||||||
|
# Push mode. Can be 'sync' or 'thread'. Sync is blocking, thread is non-blocking. Defaults to sync. Optional.
|
||||||
},
|
},
|
||||||
'console': {
|
'console': {
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
|
|
@ -338,8 +341,10 @@ STORAGES = {
|
||||||
"MINIO_ENDPOINT": config('MINIO_ENDPOINT', default='drive.gooyal.com'),
|
"MINIO_ENDPOINT": config('MINIO_ENDPOINT', default='drive.gooyal.com'),
|
||||||
"MINIO_USE_HTTPS": config('MINIO_USE_HTTPS', default=True, cast=bool),
|
"MINIO_USE_HTTPS": config('MINIO_USE_HTTPS', default=True, cast=bool),
|
||||||
|
|
||||||
"MINIO_EXTERNAL_ENDPOINT": config('MINIO_EXTERNAL_ENDPOINT', default='drive.gooyal.com'), # Default is same as MINIO_ENDPOINT
|
"MINIO_EXTERNAL_ENDPOINT": config('MINIO_EXTERNAL_ENDPOINT', default='drive.gooyal.com'),
|
||||||
"MINIO_EXTERNAL_ENDPOINT_USE_HTTPS": config('MINIO_EXTERNAL_ENDPOINT_USE_HTTPS', default=True, cast=bool), # Default is same as MINIO_USE_HTTPS
|
# Default is same as MINIO_ENDPOINT
|
||||||
|
"MINIO_EXTERNAL_ENDPOINT_USE_HTTPS": config('MINIO_EXTERNAL_ENDPOINT_USE_HTTPS', default=True, cast=bool),
|
||||||
|
# Default is same as MINIO_USE_HTTPS
|
||||||
"MINIO_REGION": None, # Default is set to None
|
"MINIO_REGION": None, # Default is set to None
|
||||||
"MINIO_ACCESS_KEY": config('MINIO_ACCESS_KEY'),
|
"MINIO_ACCESS_KEY": config('MINIO_ACCESS_KEY'),
|
||||||
"MINIO_SECRET_KEY": config('MINIO_SECRET_KEY'),
|
"MINIO_SECRET_KEY": config('MINIO_SECRET_KEY'),
|
||||||
|
|
@ -388,8 +393,10 @@ MINIO_HTTP_CLIENT: urllib3.poolmanager.PoolManager = urllib3.PoolManager(
|
||||||
MINIO_ENDPOINT = config('MINIO_ENDPOINT', default='drive.gooyal.ir')
|
MINIO_ENDPOINT = config('MINIO_ENDPOINT', default='drive.gooyal.ir')
|
||||||
MINIO_USE_HTTPS = config('MINIO_USE_HTTPS', default=True, cast=bool)
|
MINIO_USE_HTTPS = config('MINIO_USE_HTTPS', default=True, cast=bool)
|
||||||
|
|
||||||
MINIO_EXTERNAL_ENDPOINT = config('MINIO_EXTERNAL_ENDPOINT', default='drive.gooyal.com') # Default is same as MINIO_ENDPOINT
|
MINIO_EXTERNAL_ENDPOINT = config('MINIO_EXTERNAL_ENDPOINT',
|
||||||
MINIO_EXTERNAL_ENDPOINT_USE_HTTPS = config('MINIO_EXTERNAL_ENDPOINT_USE_HTTPS', default=True, cast=bool) # Default is same as MINIO_USE_HTTPS
|
default='drive.gooyal.com') # Default is same as MINIO_ENDPOINT
|
||||||
|
MINIO_EXTERNAL_ENDPOINT_USE_HTTPS = config('MINIO_EXTERNAL_ENDPOINT_USE_HTTPS', default=True,
|
||||||
|
cast=bool) # Default is same as MINIO_USE_HTTPS
|
||||||
MINIO_REGION = None # Default is set to None
|
MINIO_REGION = None # Default is set to None
|
||||||
MINIO_ACCESS_KEY = config('MINIO_ACCESS_KEY')
|
MINIO_ACCESS_KEY = config('MINIO_ACCESS_KEY')
|
||||||
MINIO_SECRET_KEY = config('MINIO_SECRET_KEY')
|
MINIO_SECRET_KEY = config('MINIO_SECRET_KEY')
|
||||||
|
|
@ -408,4 +415,4 @@ MINIO_PUBLIC_BUCKETS = [
|
||||||
MINIO_POLICY_HOOKS: List[Tuple[str, dict]] = []
|
MINIO_POLICY_HOOKS: List[Tuple[str, dict]] = []
|
||||||
MINIO_BUCKET_CHECK_ON_SAVE = True # Default: True // Creates bucket if missing, then save
|
MINIO_BUCKET_CHECK_ON_SAVE = True # Default: True // Creates bucket if missing, then save
|
||||||
|
|
||||||
MOBIN_SMS_TOKEN = config('MOBIN_SMS_TOKEN', default='')
|
MOBIN_SMS_TOKEN = config('MOBIN_SMS_TOKEN', default='')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue