diff --git a/accounts/settings.py b/accounts/settings.py index 22ba980..5b50729 100644 --- a/accounts/settings.py +++ b/accounts/settings.py @@ -119,6 +119,11 @@ REST_FRAMEWORK = { # 'DEFAULT_THROTTLE_CLASSES': [ # 'rest_framework.throttling.AnonRateThrottle', # ], + 'DEFAULT_THROTTLE_CLASSES': [ + 'apps.gooyal_oauth2.throttling.TokenLimitThrottle', + # 'rest_framework.throttling.AnonRateThrottle', + # 'rest_framework.throttling.UserRateThrottle' + ], 'DEFAULT_THROTTLE_RATES': { 'otp_min': '2/min', 'otp_day': '200/day', @@ -225,7 +230,6 @@ LANGUAGES = [ ('tr', _('Turkish')), ] - LOCALE_PATHS = [ 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_SECRET = config('PAYAM_SMS_CLIENT_SECRET') - SMS_OTP_SIGNITURE = config('SMS_OTP_SIGNITURE', '') -SMS_SEND=config('SMS_SEND', True, cast=bool) -TEST_PHONENUMBERS=config('TEST_PHONENUMBERS', [], cast=Csv(post_process=list)) - +SMS_SEND = config('SMS_SEND', True, cast=bool) +TEST_PHONENUMBERS = config('TEST_PHONENUMBERS', [], cast=Csv(post_process=list)) CACHES = { "default": { @@ -311,7 +313,8 @@ LOGGING = { '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 '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': { 'level': 'DEBUG', @@ -338,8 +341,10 @@ STORAGES = { "MINIO_ENDPOINT": config('MINIO_ENDPOINT', default='drive.gooyal.com'), "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_USE_HTTPS": config('MINIO_EXTERNAL_ENDPOINT_USE_HTTPS', default=True, cast=bool), # Default is same as MINIO_USE_HTTPS + "MINIO_EXTERNAL_ENDPOINT": config('MINIO_EXTERNAL_ENDPOINT', 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_ACCESS_KEY": config('MINIO_ACCESS_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_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_USE_HTTPS = config('MINIO_EXTERNAL_ENDPOINT_USE_HTTPS', default=True, cast=bool) # Default is same as MINIO_USE_HTTPS +MINIO_EXTERNAL_ENDPOINT = config('MINIO_EXTERNAL_ENDPOINT', + 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_ACCESS_KEY = config('MINIO_ACCESS_KEY') MINIO_SECRET_KEY = config('MINIO_SECRET_KEY') @@ -408,4 +415,4 @@ MINIO_PUBLIC_BUCKETS = [ MINIO_POLICY_HOOKS: List[Tuple[str, dict]] = [] MINIO_BUCKET_CHECK_ON_SAVE = True # Default: True // Creates bucket if missing, then save -MOBIN_SMS_TOKEN = config('MOBIN_SMS_TOKEN', default='') \ No newline at end of file +MOBIN_SMS_TOKEN = config('MOBIN_SMS_TOKEN', default='')