- Add InspectionRecord model with is_federal_law_248, data_year, data_month fields - Add ProverkiClient with Playwright support for JS-rendered portal - Add streaming XML parser for large files (>50MB) - Add sync_inspections task with incremental loading logic - Starts from 01.01.2025 if DB is empty - Loads both FZ-294 and FZ-248 inspections - Stops after 2 consecutive empty months - Add InspectionService methods: get_last_loaded_period, has_data_for_period - Add Minpromtorg parsers (certificates, manufacturers) - Add Django Admin for parser models - Update README with parsers documentation and changelog
52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
import os
|
|
|
|
from .base import *
|
|
|
|
# Development settings - unsuitable for production
|
|
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
SECRET_KEY = os.getenv(
|
|
"SECRET_KEY", "django-insecure-development-key-change-in-production"
|
|
)
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = os.getenv("DEBUG", "True").lower() in ("true", "1", "yes")
|
|
|
|
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "0.0.0.0", "testserver", "*"] # noqa: S104
|
|
|
|
# Database for development
|
|
DATABASES = {
|
|
"default": {
|
|
"ENGINE": "django.db.backends.postgresql",
|
|
"NAME": os.getenv("POSTGRES_DB", "project_dev"),
|
|
"USER": os.getenv("POSTGRES_USER", "postgres"),
|
|
"PASSWORD": os.getenv("POSTGRES_PASSWORD", "postgres"),
|
|
"HOST": os.getenv("POSTGRES_HOST", "localhost"),
|
|
"PORT": os.getenv("POSTGRES_PORT", "5432"),
|
|
}
|
|
}
|
|
|
|
# Celery Configuration for Development
|
|
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", "redis://localhost:6379/0")
|
|
CELERY_RESULT_BACKEND = os.getenv("CELERY_RESULT_BACKEND", "redis://localhost:6379/0")
|
|
CELERY_ACCEPT_CONTENT = ["json"]
|
|
CELERY_TASK_SERIALIZER = "json"
|
|
CELERY_RESULT_SERIALIZER = "json"
|
|
CELERY_TIMEZONE = "Europe/Moscow"
|
|
|
|
# Email backend for development
|
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
|
|
|
# Cache configuration for development
|
|
REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/1")
|
|
CACHES = {
|
|
"default": {
|
|
"BACKEND": "django_redis.cache.RedisCache",
|
|
"LOCATION": REDIS_URL,
|
|
"OPTIONS": {
|
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
|
},
|
|
}
|
|
}
|