diff --git a/accounts/settings.py b/accounts/settings.py index 9e5a63f..ff486d0 100644 --- a/accounts/settings.py +++ b/accounts/settings.py @@ -119,15 +119,15 @@ REST_FRAMEWORK = { # 'rest_framework.throttling.AnonRateThrottle', # ], 'DEFAULT_THROTTLE_RATES': { - 'otp_min': '1/min', + 'otp_min': '2/min', 'otp_day': '50/day', }, 'EXCEPTION_HANDLER': 'utils.exceptions.exception_handler', } SPECTACULAR_SETTINGS = { - 'TITLE': 'Gooyal Accounts', - 'DESCRIPTION': 'Gooyal Accounts API reference', + 'TITLE': 'Accounts', + 'DESCRIPTION': 'Accounts API reference', 'VERSION': '1.0.0', 'SERVE_INCLUDE_SCHEMA': False, # OTHER SETTINGS diff --git a/utils/i18n.py b/utils/i18n.py new file mode 100644 index 0000000..481aec4 --- /dev/null +++ b/utils/i18n.py @@ -0,0 +1,14 @@ +from django.utils import translation + +class ForceAdminLanguageMiddleware: + def __init__(self, get_response): + self.get_response = get_response + + def __call__(self, request): + if request.path.startswith('/admin/'): + translation.activate('en') + request.LANGUAGE_CODE = 'en' + else: + translation.activate('fa') + request.LANGUAGE_CODE = 'fa' + return self.get_response(request) \ No newline at end of file