Files
homm/.env.example
T
apuc 756f40353b Add Django backend, 1C integration, deploy config and API docs
Backend (Django 4.2 + DRF):
- accounts: phone OTP login, JWT, profile, addresses
- catalog: categories, products, images, filters, search, hits/new/related
- orders: creation with Idempotency-Key, stock reservation, status history, cancel
- loyalty: bonus accounts, promo codes, gift certificates
- payments: payment records and YooKassa webhook handling
- content: static pages, banners, site settings
- integration: 1C exchange (catalog sync, order push via outbox, statuses, bonuses)
- common: error envelope, pagination, request-id, integration auth, admin dashboard

Infrastructure: Dockerfile, docker-compose (Postgres, Redis, Celery worker/beat, Nginx),
requirements split by environment, OpenAPI contracts for site and 1C, architecture doc.

Tests: 22 pytest cases covering catalog, orders, idempotency, OTP, integration.
2026-11-22 21:54:16 +03:00

47 lines
1.2 KiB
Bash

# --- Django ---
DJANGO_SETTINGS_MODULE=config.settings.dev
DJANGO_SECRET_KEY=change-me-in-production
DJANGO_DEBUG=true
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
# --- Database ---
# sqlite | postgres
DB_ENGINE=sqlite
POSTGRES_DB=homm
POSTGRES_USER=homm
POSTGRES_PASSWORD=homm
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
# --- Redis / Celery ---
REDIS_URL=redis://localhost:6379/0
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/1
# --- CORS ---
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
# --- Auth / OTP ---
OTP_TTL_SECONDS=300
OTP_MAX_ATTEMPTS=5
# Only for local development: fixed OTP code. Leave empty in production.
OTP_DEBUG_CODE=0000
# --- 1C integration ---
# Shared secret used by 1C when calling the site integration API.
INTEGRATION_API_TOKEN=dev-integration-token
# Base URL of the 1C HTTP service (outbound calls from the site).
ONEC_BASE_URL=http://1c.local/homm/hs/homm
ONEC_USERNAME=
ONEC_PASSWORD=
ONEC_TIMEOUT=30
# --- Email ---
EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
DEFAULT_FROM_EMAIL=noreply@homm.local
# --- Payments ---
YOOKASSA_SHOP_ID=
YOOKASSA_SECRET_KEY=
YOOKASSA_RETURN_URL=http://localhost:3000/checkout/success