iac/apps/inspections/asterus/production-configmap.yaml
2026-09-23 23:36:27 +05:00

72 lines
1.9 KiB
YAML

apiVersion: v1
data:
production.py: |-
import os
from .base import * # noqa: F401, F403
# Base settings
DEBUG = True
ALLOWED_HOSTS = [
"*",
]
# REST framework settings
REST_FRAMEWORK = {
"DEFAULT_FILTER_BACKENDS": [
"django_filters.rest_framework.DjangoFilterBackend",
],
"DEFAULT_RENDERER_CLASSES": [
"rest_framework.renderers.JSONRenderer",
],
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
"PAGE_SIZE": 100,
}
# Database settings
DATABASES = {
"default": {
"ENGINE": "core.db.backends.postgis",
"NAME": os.getenv("POSTGRES_DB") or "postgres",
"HOST": os.getenv("POSTGRES_HOST") or "postgres",
"PORT": os.getenv("POSTGRES_PORT") or "5432",
"USER": os.getenv("POSTGRES_USER") or "postgres",
"PASSWORD": os.getenv("POSTGRES_PASSWORD") or "postgres",
}
}
# CORS settings
CORS_ALLOWED_ORIGINS = [
"https://localhost.8000",
"https://localhost.8080",
"https://cde.brusnika.ru"
]
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_METHODS = [
"GET",
"OPTIONS",
"POST",
"PUT",
"PATCH",
"DELETE",
]
# S3 settings
AWS_S3_ENDPOINT_URL = os.getenv("YC_S3_ENDPOINT_URL")
AWS_STORAGE_BUCKET_NAME = os.getenv("YC_S3_BUCKET_NAME")
AWS_ACCESS_KEY_ID = os.getenv("YC_S3_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("YC_S3_SECRET_ACCESS_KEY")
AWS_DEFAULT_ACL = "public-read"
if AWS_S3_ENDPOINT_URL and AWS_STORAGE_BUCKET_NAME and AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY:
STATICFILES_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
kind: ConfigMap
metadata:
name: production-configmap
namespace: inspections