feat: Add comprehensive Django user app with tests using model-bakery

- Implemented user authentication with JWT tokens
- Added user and profile models with OneToOne relationship
- Created service layer for business logic separation
- Implemented DRF serializers and views
- Added comprehensive test suite with model-bakery factories
- Fixed ipdb/pdbpp dependency conflicts with custom test runner
- Configured development and production environments
- Added deployment configurations for Apache, systemd, and Docker
This commit is contained in:
2026-01-19 14:12:33 +01:00
commit cbfbd8652d
51 changed files with 4183 additions and 0 deletions

62
Makefile Normal file
View File

@@ -0,0 +1,62 @@
# Makefile для удобной работы с проектом
.PHONY: help install dev-up dev-down test lint format migrate createsuperuser shell
help:
@echo "Доступные команды:"
@echo " make install - Установка зависимостей"
@echo " make dev-up - Запуск разработческого окружения (Docker)"
@echo " make dev-down - Остановка разработческого окружения"
@echo " make migrate - Выполнение миграций Django"
@echo " make createsuperuser - Создание суперпользователя"
@echo " make test - Запуск тестов"
@echo " make lint - Проверка кода линтерами"
@echo " make format - Форматирование кода"
@echo " make shell - Запуск Django shell"
@echo " make logs - Просмотр логов (Docker)"
@echo " make clean - Очистка временных файлов"
install:
uv pip install -r requirements.txt
uv pip install -r requirements-dev.txt
dev-up:
docker-compose up -d
@echo "Сервисы запущены. Приложение доступно по адресу: http://localhost:8000"
dev-down:
docker-compose down
test:
pytest src/ -v
lint:
flake8 src/
black --check src/
isort --check-only src/
format:
black src/
isort src/
flake8 src/
migrate:
cd src && python manage.py makemigrations
cd src && python manage.py migrate
createsuperuser:
cd src && python manage.py createsuperuser
shell:
cd src && python manage.py shell
logs:
docker-compose logs -f
clean:
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
rm -rf *.log
rm -rf htmlcov/
rm -rf .coverage
rm -rf .pytest_cache/