- Replaced feed-* inline styles in base.html with feed-cards.css component (~60 lines) - Replaced ios-search inline styles in 3 templates with ios-search.css component * employees/employees_list.html * search/results.html * employees/department_list.html - Eliminated ~150 lines of duplicate CSS across templates - All 17 tests passing
1.6 KiB
1.6 KiB
EUSRR Backend — Quickstart
What’s inside
- Django 5.2, DRF, SimpleJWT
- Apps: employees, requests_app (HR requests), calendar_app, feed (news), communications (chat via Channels), bots (Telegram via aiogram), documents, search, hikcentral (read-only models to external DB)
- ASGI via Channels; Redis required for websockets
Local run (SQLite, no websockets)
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r backend/requirements.txt
cp backend/.env backend/.env.local || true
# Edit backend/.env.local if needed (USE_SQLITE=True by default)
python backend/manage.py migrate
python backend/manage.py createsuperuser
python backend/manage.py runserver 0.0.0.0:9000
Full stack with Docker (Postgres + Redis)
- Put your secrets into
backend/.env(use.env.exampleas a template). Never commit real secrets. - Ensure the
Dockerfileuseseusrr_backend.asgi(or use the providedDockerfile.fixed). - Launch:
docker compose up --build
The app will be available at http://127.0.0.1:9000/
Useful commands
# Start Telegram bot
python backend/manage.py start_telegram_bot
# Run tests
pytest -q backend
Notes
- Set
API_BASE_URLto match where the app is served (default: http://127.0.0.1:9000/api). - For Channels websockets, ensure Redis is reachable at
${REDIS_HOST}:${REDIS_PORT}. - The
hikcentralDB is configured as a secondary Postgres. Externalize its DSN via environment variables if you plan to use it.