This commit is contained in:
2025-10-28 03:21:01 +01:00
parent 10796dcb31
commit 73da41b514
44 changed files with 1868 additions and 452 deletions

View File

@@ -264,6 +264,11 @@ REST_FRAMEWORK = {
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'],
'DEFAULT_THROTTLE_RATES': {
'anon': '100/hour', # unauthenticated
'user': '2000/hour', # authenticated
}
}
#--------------------------------END REST FRAMEWORK 🛠️-------------------------------------
@@ -273,6 +278,11 @@ REST_FRAMEWORK = {
#-------------------------------------APPS 📦------------------------------------
MY_CREATED_APPS = [
'account',
'commerce',
'thirdparty.downloader',
'thirdparty.stripe', # register Stripe app so its models are recognized
'thirdparty.trading212',
]
INSTALLED_APPS = [
@@ -893,3 +903,10 @@ SPECTACULAR_DEFAULTS: Dict[str, Any] = {
'OAUTH2_REFRESH_URL': None,
'OAUTH2_SCOPES': None,
}
# -------------------------------------DOWNLOADER LIMITS------------------------------------
DOWNLOADER_MAX_SIZE_MB = int(os.getenv("DOWNLOADER_MAX_SIZE_MB", "200")) # Raspberry Pi safe cap
DOWNLOADER_MAX_SIZE_BYTES = DOWNLOADER_MAX_SIZE_MB * 1024 * 1024
DOWNLOADER_TIMEOUT = int(os.getenv("DOWNLOADER_TIMEOUT", "120")) # seconds
DOWNLOADER_TMP_DIR = os.getenv("DOWNLOADER_TMP_DIR", str(BASE_DIR / "tmp" / "downloader"))
# -------------------------------------END DOWNLOADER LIMITS--------------------------------