A backend service for managing and sharing recipes, subscribing to authors, adding favorites, and generating shopping lists.
| Category | Technologies |
|---|---|
| Backend | Python 3.9, Django 3.2, Django REST Framework |
| Authentication | Djoser, Simple JWT |
| Database | PostgreSQL |
| Containerization | Docker, Docker Compose |
| CI/CD | GitHub Actions, Nginx |
git clone https://github.com/Maximus2012/foodgram-st.git
cd foodgram-st/infraCreate a .env file at:
foodgram-st/infra/.env
Example content:
DEBUG=False
SECRET_KEY=your-django-secret-key
DB_NAME=foodgram
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=db
DB_PORT=5432
ALLOWED_HOSTS=127.0.0.1,localhost,example.comdocker compose build
docker compose upAfter startup, the project will be available at:
👉 http://localhost/recipes
Django Admin Panel
Accessible at:
👉 http://localhost/admin/
API
Accessible at:
👉 http://localhost/api/docs/
- Go to the
backendfolder:
cd ../backend- Create a virtual environment:
python -m venv venv- Activate it:
- Windows:
venv\Scripts\activate- macOS/Linux:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Apply migrations:
python manage.py migrate- Load initial ingredient data:
python manage.py import_data- Run the server:
python manage.py runserverAfter startup, the project will be available at:
👉 http://127.0.0.1:8000
You can use fixtures to load users and recipes:
python manage.py loaddata users_and_recipes.jsonfoodgram-st/
├── backend/ # Django project
├── frontend/ # Optional React app
├── infra/
│ ├── docker-compose.yml # Docker Compose config
│ └── nginx.conf # Nginx config
├── data/ # Initial ingredients
└── docs/ # API documentation
Max Kochetkov
GitHub Profile