Sous-Vide Zen is a website for sharing and discovering recipes for sous-vide cooking, a technique that involves cooking food in vacuum-sealed bags at precise temperatures. Users can create their own recipes, browse popular and featured recipes, follow other users, react and comment on recipes, and save their favorites.
- Registration and authorization on the site
- Share recipes
- Popular recipes feed
- Subscription feed
- Share recipes
- Comment recipes
- Reactions to recipes and comments
- Favorite recipes
- Hash tags
- Search recipe database
- Python 3.11
- Django 4.2.6
- Django REST Framework 3.14.0
- PostgreSQL
- Djoser
- Black
Clone the repository:
git clone git@github.com:Sous-Vide-Zen/backend.gitNavigate to the project directory:
cd backend- If you don’t have Docker installed, please install it.
- Then execute it
docker build -t svz-back . - After it was built execute it
docker run -p 8000:8000 svz-back
- Windows
python -m venv venv
. venv/Scripts/activate
pip install -r src/requirements/requirements-dev.txt- Linux and macOS
python3.11 -m venv venv
. venv/bin/activate
pip install -r src/requirements/requirements-dev.txtNow the application settings are divided into product and local. In order to use local settings, you need to create a file local_settings.py in the config/settings/ directory. An example of the file contents:
from pathlib import Path
DEBUG = True
BASE_DIR = Path(__file__).resolve().parent.parent.parent
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "0.0.0.0"]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
SOCIAL_AUTH_VK_OAUTH2_KEY = "Your VK OAuth 2.0 key"
SOCIAL_AUTH_VK_OAUTH2_SECRET = "Your VK OAuth 2.0 secret"
SOCIAL_AUTH_YANDEX_OAUTH2_KEY = "Your Yandex OAuth 2.0 key"
SOCIAL_AUTH_YANDEX_OAUTH2_SECRET = "Your Yandex OAuth 2.0 secret"
CORS_ALLOW_ALL_ORIGINS = TrueCreate an env file and, if necessary, fill it with your variables or use default values.(This step can be skipped for local deployment)
cp .env.example .envLaunch a project:
python manage.py migrate
python manage.py runserverFill the database:
python manage.py loaddata $(ls src/fixtures/)http://127.0.0.1:8000/api/v1/swagger/
Эндпоинты регистрации через соц.сети
http://127.0.0.1:8000/api/v1/login/yandex-oauth2/ - регистрация через яндекс
http://127.0.0.1:8000/api/v1/login/vk-oauth2 - регистрация через вк
Настройка редиректа, на проде нужно поменять 127.0.0.1:8000 на домен
http://127.0.0.1:8000/api/v1/complete/yandex-oauth2/
http://127.0.0.1:8000/api/v1/complete/vk-oauth2/ - настраивается в vk.com/dev