Compare commits

..

2 Commits

3 changed files with 29 additions and 27 deletions

View File

@@ -7,6 +7,7 @@ from datetime import timedelta
import sys import sys
import warnings import warnings
from pathlib import Path from pathlib import Path
from typing import List
from decouple import config from decouple import config
# Suppress django-allauth deprecation warnings for dj_rest_auth compatibility # Suppress django-allauth deprecation warnings for dj_rest_auth compatibility
@@ -19,14 +20,14 @@ warnings.filterwarnings(
# Initialize environment variables with better defaults # Initialize environment variables with better defaults
DEBUG = config("DEBUG", default=True) DEBUG = config("DEBUG", default=True, cast=bool)
SECRET_KEY = config("SECRET_KEY") SECRET_KEY = config("SECRET_KEY")
ALLOWED_HOSTS = config("ALLOWED_HOSTS", default="localhost,127.0.0.1", cast=lambda v: [s.strip() for s in v.split(',') if s.strip()]) ALLOWED_HOSTS = config("ALLOWED_HOSTS", default="localhost,127.0.0.1", cast=lambda v: [s.strip() for s in str(v).split(',') if s.strip()])
DATABASE_URL = config("DATABASE_URL") DATABASE_URL = config("DATABASE_URL")
CACHE_URL = config("CACHE_URL", default="locmem://") CACHE_URL = config("CACHE_URL", default="locmem://")
EMAIL_URL = config("EMAIL_URL", default="console://") EMAIL_URL = config("EMAIL_URL", default="console://")
REDIS_URL = config("REDIS_URL", default="redis://127.0.0.1:6379/1") REDIS_URL = config("REDIS_URL", default="redis://127.0.0.1:6379/1")
CORS_ALLOWED_ORIGINS = config("CORS_ALLOWED_ORIGINS", default="", cast=lambda v: [s.strip() for s in v.split(',') if s.strip()]) CORS_ALLOWED_ORIGINS = config("CORS_ALLOWED_ORIGINS", default="", cast=lambda v: [s.strip() for s in str(v).split(',') if s.strip()])
API_RATE_LIMIT_PER_MINUTE = config("API_RATE_LIMIT_PER_MINUTE", default=60) API_RATE_LIMIT_PER_MINUTE = config("API_RATE_LIMIT_PER_MINUTE", default=60)
API_RATE_LIMIT_PER_HOUR = config("API_RATE_LIMIT_PER_HOUR", default=1000) API_RATE_LIMIT_PER_HOUR = config("API_RATE_LIMIT_PER_HOUR", default=1000)
CACHE_MIDDLEWARE_SECONDS = config("CACHE_MIDDLEWARE_SECONDS", default=300) CACHE_MIDDLEWARE_SECONDS = config("CACHE_MIDDLEWARE_SECONDS", default=300)
@@ -55,7 +56,7 @@ SECRET_KEY = config("SECRET_KEY")
# CSRF trusted origins # CSRF trusted origins
CSRF_TRUSTED_ORIGINS = config( CSRF_TRUSTED_ORIGINS = config(
"CSRF_TRUSTED_ORIGINS", default="", cast=lambda v: [s.strip() for s in v.split(',') if s.strip()] "CSRF_TRUSTED_ORIGINS", default="", cast=lambda v: [s.strip() for s in str(v).split(',') if s.strip()]
) )
# Application definition # Application definition

View File

@@ -76,10 +76,33 @@ dev = [
[tool.pyright] [tool.pyright]
stubPath = "stubs" stubPath = "stubs"
typeCheckingMode = "basic" include = ["."]
exclude = [
"**/node_modules",
"**/__pycache__",
"**/migrations",
"**/.venv",
"**/venv",
"**/.git",
"**/.hg",
"**/.tox",
"**/.nox",
]
typeCheckingMode = "strict"
reportIncompatibleMethodOverride = "error"
reportIncompatibleVariableOverride = "error"
reportGeneralTypeIssues = "error"
reportReturnType = "error"
reportMissingImports = "error"
reportMissingTypeStubs = "warning"
reportUndefinedVariable = "error"
reportUnusedImport = "warning"
reportUnusedVariable = "warning"
pythonVersion = "3.13"
[tool.pylance] [tool.pylance]
stubPath = "stubs" stubPath = "stubs"
[tool.uv.sources] [tool.uv.sources]
python-json-logger = { url = "https://github.com/nhairs/python-json-logger/releases/download/v3.0.0/python_json_logger-3.0.0-py3-none-any.whl" } python-json-logger = { url = "https://github.com/nhairs/python-json-logger/releases/download/v3.0.0/python_json_logger-3.0.0-py3-none-any.whl" }

View File

@@ -1,22 +0,0 @@
{
"include": [
"."
],
"exclude": [
"**/node_modules",
"**/__pycache__",
"**/migrations"
],
"stubPath": "stubs",
"typeCheckingMode": "strict",
"reportIncompatibleMethodOverride": "error",
"reportIncompatibleVariableOverride": "error",
"reportGeneralTypeIssues": "error",
"reportReturnType": "error",
"reportMissingImports": "error",
"reportMissingTypeStubs": "warning",
"reportUndefinedVariable": "error",
"reportUnusedImport": "warning",
"reportUnusedVariable": "warning",
"pythonVersion": "3.13"
}