Refactor project structure and update configurations for State Corp backend

- Updated project description in __init__.py
- Enhanced .gitignore to exclude additional data files
- Modified User model to remove first_name and last_name fields
- Improved instance save method in services.py to include updated_at field
- Added API tokens to .env.example for external services
- Cleaned up test files for better readability
- Updated Dockerfile and docker-compose.yml for improved setup
- Revised README.md to reflect project changes and added changelog
This commit is contained in:
2026-02-17 09:24:42 +01:00
parent e9d7f24aaa
commit fd2adf9ab4
31 changed files with 1419 additions and 933 deletions

View File

@@ -8,8 +8,13 @@ import os
from celery import Celery
# Set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development")
# Set the Django settings module for the 'celery' program.
if "DJANGO_SETTINGS_MODULE" not in os.environ:
raise RuntimeError(
"DJANGO_SETTINGS_MODULE is not set. "
"Export it explicitly before starting Celery "
"(e.g., config.settings.production or config.settings.development)."
)
app = Celery("project")
@@ -24,17 +29,24 @@ app.autodiscover_tasks()
# Configure Celery Beat schedule
app.conf.beat_schedule = {
"check-pending-scraping-jobs": {
"task": "apps.scraping.tasks.check_pending_jobs",
"schedule": 300.0, # Every 5 minutes
# Парсинг сертификатов промышленного производства - каждый день в 3:00
"parse-industrial-production-daily": {
"task": "apps.parsers.tasks.parse_industrial_production",
"schedule": 86400.0, # Every 24 hours
},
"process-extracted-data": {
"task": "apps.data_processor.tasks.process_extracted_data",
"schedule": 600.0, # Every 10 minutes
# Парсинг реестра производителей - каждый день в 4:00
"parse-manufactures-daily": {
"task": "apps.parsers.tasks.parse_manufactures",
"schedule": 86400.0, # Every 24 hours
},
# Сканирование папки FNS - каждые 5 минут
"scan-fns-directory": {
"task": "apps.parsers.tasks.scan_fns_directory",
"schedule": 300.0, # Every 5 minutes
},
}
app.conf.timezone = "UTC"
app.conf.timezone = "Europe/Moscow"
@app.task(bind=True)