A Django-based web application for e-commerce and related services.
- Django 5.2+ with REST API (DRF)
- Celery for background tasks
- Redis and MySQL support (via Docker)
- JWT authentication (djoser, simplejwt)
- Modern dev tools: Debug Toolbar, Silk, pytest, Locust
- Dockerized for easy local development
- Managed with
uv(fast Python package/project manager) - Python 3.13
- uv (recommended install:
curl -LsSf https://astral.sh/uv/install.sh | sh) - Python 3.13 (managed by uv)
- Docker and Docker Compose
git clone <your-repo-url>
cd storefrontuv python install 3.13
uv python pin 3.13uv syncThis will create a .venv and install all dependencies as defined in pyproject.toml.
Copy or edit the provided docker.env for local development. For local (non-Docker) runs, you can use a .env file with the same variables.
Example (.env):
SECRET_KEY=your-secret-key
DATABASE_URL=mysql://root:MyPassword@localhost:3306/storefront_prod
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
INTERNAL_IPS=127.0.0.1
CORS_ALLOWED_ORIGINS=http://localhost:3000
DEFAULT_FROM_EMAIL=your@email.com
EMAIL_HOST=smtp4dev
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_PORT=2525
REDIS_URL=redis://localhost:6379/1- Activate the virtual environment:
source .venv/bin/activate - Apply migrations:
uv run python manage.py migrate
- Run the development server:
uv run python manage.py runserver
- Run Celery worker (in a separate terminal):
uv run celery -A storefront worker --loglevel=info
- Run Celery beat (in a separate terminal):
uv run celery -A storefront beat --loglevel=info
-
Build and start all services:
docker compose --env-file docker.env up --build
This will start:
- Django app (web)
- MySQL
- Redis
- Celery worker & beat
- Flower (Celery monitoring)
- smtp4dev (for email testing)
-
Access the app:
- Django: http://localhost:8000
- Flower: http://localhost:5555
- smtp4dev: http://localhost:5000
uv run pytestOr with Docker:
docker compose run --rm tests- Add a new dependency:
uv add <package-name>
- Add a dev dependency:
uv add --group dev <package-name>
- Sync dependencies:
uv sync
- Run management commands:
uv run python manage.py <command>
- The project uses a
.python-versionfile to pin Python 3.13 for uv. - All dependencies are managed via
pyproject.tomlanduv.lock. - For advanced usage, see the uv documentation.