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:
211
pyproject.toml
Normal file
211
pyproject.toml
Normal file
@@ -0,0 +1,211 @@
|
||||
[project]
|
||||
name = "mostovik-backend"
|
||||
version = "0.1.0"
|
||||
description = "Backend service for Mostovik project"
|
||||
authors = [
|
||||
{name = "Your Name", email = "your.email@example.com"},
|
||||
]
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
# Django Framework
|
||||
"Django==3.2.25",
|
||||
"djangorestframework==3.14.0",
|
||||
# Database
|
||||
"psycopg2-binary==2.9.9",
|
||||
# Async tasks
|
||||
"celery==5.3.6",
|
||||
"redis==5.0.3",
|
||||
"django-celery-beat==2.6.0",
|
||||
"django-celery-results==2.5.1",
|
||||
# Caching
|
||||
"django-redis==5.4.0",
|
||||
# Data processing
|
||||
"pandas==2.0.3",
|
||||
"numpy==1.24.4",
|
||||
"requests==2.31.0",
|
||||
"beautifulsoup4==4.12.3",
|
||||
# Web scraping
|
||||
"scrapy==2.11.2",
|
||||
"selenium==4.17.2",
|
||||
# Validation and serialization
|
||||
"django-filter==23.5",
|
||||
"django-cors-headers==4.3.1",
|
||||
# Logging and monitoring
|
||||
"python-json-logger==2.0.7",
|
||||
# Utilities
|
||||
"python-dotenv==1.0.1",
|
||||
"python-dateutil==2.8.2",
|
||||
"pytz==2024.1",
|
||||
# Security
|
||||
"cryptography==42.0.5",
|
||||
"djangorestframework-simplejwt>=5.3.1",
|
||||
"drf-yasg>=1.21.10",
|
||||
"pillow>=12.1.0",
|
||||
"python-decouple>=3.8",
|
||||
"coreapi>=2.3.3",
|
||||
"django-rest-swagger>=2.2.0",
|
||||
"model-bakery>=1.17.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
# WSGI server
|
||||
"gunicorn==21.2.0",
|
||||
"gevent==23.9.1",
|
||||
|
||||
# Development
|
||||
"django-extensions==3.2.3",
|
||||
"werkzeug==3.0.1",
|
||||
"django-debug-toolbar==4.2.0",
|
||||
|
||||
# Testing
|
||||
"pytest==7.4.4",
|
||||
"pytest-django==4.7.0",
|
||||
"pytest-cov==4.1.0",
|
||||
"factory-boy==3.3.0",
|
||||
"coverage==7.4.0",
|
||||
|
||||
# Linters and formatters
|
||||
"flake8==6.1.0",
|
||||
"black==23.12.1",
|
||||
"isort==5.13.2",
|
||||
"ruff==0.1.14",
|
||||
|
||||
# Documentation
|
||||
"sphinx==7.2.6",
|
||||
"sphinx-rtd-theme==2.0.0",
|
||||
|
||||
# Monitoring
|
||||
"flower==2.0.1",
|
||||
|
||||
# CLI tools
|
||||
"click==8.1.7",
|
||||
"typer==0.9.0",
|
||||
|
||||
# Debugging
|
||||
"ipdb==0.13.13",
|
||||
"pdbpp==0.10.3",
|
||||
|
||||
# Additional tools
|
||||
"watchdog==3.0.0",
|
||||
|
||||
# Pre-commit hooks
|
||||
"pre-commit==3.6.0",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=45", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = ["src"]
|
||||
|
||||
[tool.ruff]
|
||||
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
|
||||
lint.select = [
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
"C", # mccabe
|
||||
"B", # flake8-bugbear
|
||||
"Q", # flake8-quotes
|
||||
"DJ", # flake8-django
|
||||
]
|
||||
|
||||
lint.extend-ignore = [
|
||||
"E501", # line too long, handled by formatter
|
||||
"DJ01", # Missing docstring (too strict for Django)
|
||||
]
|
||||
|
||||
# Allow autofix for all enabled rules (when `--fix`) is provided.
|
||||
lint.fixable = ["ALL"]
|
||||
lint.unfixable = []
|
||||
|
||||
# Allow unused variables when underscore-prefixed.
|
||||
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||
|
||||
# Exclude a variety of commonly ignored directories.
|
||||
exclude = [
|
||||
".bzr",
|
||||
".direnv",
|
||||
".eggs",
|
||||
".git",
|
||||
".git-rewrite",
|
||||
".hg",
|
||||
".mypy_cache",
|
||||
".nox",
|
||||
".pants.d",
|
||||
".pytype",
|
||||
".ruff_cache",
|
||||
".svn",
|
||||
".tox",
|
||||
".venv",
|
||||
"__pypackages__",
|
||||
"_build",
|
||||
"buck-out",
|
||||
"build",
|
||||
"dist",
|
||||
"node_modules",
|
||||
"venv",
|
||||
"*/migrations/*",
|
||||
"*/__pycache__/*",
|
||||
]
|
||||
|
||||
# Same as Black.
|
||||
line-length = 88
|
||||
|
||||
# Assume Python 3.11.
|
||||
target-version = "py311"
|
||||
|
||||
[tool.ruff.lint.mccabe]
|
||||
# Unlike Flake8, default to a complexity level of 10.
|
||||
max-complexity = 10
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
# Ignore `E402` (import violations) in all `__init__.py` files
|
||||
"__init__.py" = ["E402"]
|
||||
# Ignore complexity issues in tests
|
||||
"tests/*" = ["C901"]
|
||||
"**/test_*" = ["C901"]
|
||||
"**/tests.py" = ["C901"]
|
||||
|
||||
[tool.ruff.format]
|
||||
# Like Black, use double quotes for strings.
|
||||
quote-style = "double"
|
||||
|
||||
# Like Black, indent with spaces, rather than tabs.
|
||||
indent-style = "space"
|
||||
|
||||
# Like Black, respect magic trailing commas.
|
||||
skip-magic-trailing-comma = false
|
||||
|
||||
# Like Black, automatically detect the appropriate line ending.
|
||||
line-ending = "auto"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"gunicorn==21.2.0",
|
||||
"gevent==23.9.1",
|
||||
"django-extensions==3.2.3",
|
||||
"werkzeug==3.0.1",
|
||||
"django-debug-toolbar==4.2.0",
|
||||
"pytest==7.4.4",
|
||||
"pytest-django==4.7.0",
|
||||
"pytest-cov==4.1.0",
|
||||
"factory-boy==3.3.0",
|
||||
"coverage==7.4.0",
|
||||
"flake8==6.1.0",
|
||||
"black==23.12.1",
|
||||
"isort==5.13.2",
|
||||
"ruff==0.1.14",
|
||||
"sphinx==7.2.6",
|
||||
"sphinx-rtd-theme==2.0.0",
|
||||
"flower==2.0.1",
|
||||
"click==8.1.7",
|
||||
"typer==0.9.0",
|
||||
"ipdb==0.13.13",
|
||||
"pdbpp==0.10.3",
|
||||
"watchdog==3.0.0",
|
||||
"pre-commit==3.6.0",
|
||||
]
|
||||
Reference in New Issue
Block a user