• Stars
    star
    129
  • Rank 278,253 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This application for posting culinary recipes. Fully ready to be hosted on your server.

Foodgram

workflow


Господа, раз уж скачиваете (собственно, для этого оно и открыто) справа вверху можно тыкнуть ⭐ .
⚠️ В docker-compose.yml в настройках для nginx вам нужно будет сменить порт 8️⃣0️⃣0️⃣1️⃣ на 8️⃣0️⃣.

У меня так настроено, потому что на одном сервере и IP висит несколько сайтов.

Кроме того, раз Яндекс за 3 года не сподобился придумать новый проект, претензии ревьюеров, для улучшения проекта, можно записывать сюда: Вопросы.

Имейте ввиду, что некоторые ревьюры сами не сильно углублялись в предмет, проверку проводят сравнивая с выданным им шаблоном и иногда их претензии решаются не переписыванием кода, а объяснением Вашего решения. Не стесняйтесь спорить с ними.


Tecnhologies

  • Python 3.11
  • Django 4.0
  • Django REST framework 3.14
  • Nginx
  • Docker
  • Postgres

https://foodgram.gq

С самого начала развёрнут в облачном сервисе CLO

Here you can share recipes of dishes, add them to favorites and display a shopping list for cooking your favorite dishes. To preserve order - only administrators are allowed to create tags and ingredients.

There is also an API. To view the available paths, follow the link: https://foodgram.gq/api/.

And the api documentation is here: https://foodgram.gq/api/docs/.

To deploy this project need the next actions

  • Download project with SSH (actually you only need the folder 'infra/')
git clone [email protected]:Xewus/foodgram-project-react.git
  • Connect to your server:
ssh <server user>@<server IP>
  • Install Docker on your server
sudo apt install docker.io
  • Install Docker Compose (for Linux)
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  • Get permissions for docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  • Create project directory (preferably in your home directory)
mkdir foodgram && cd foodgram/
  • Create env-file:
touch .env
  • Fill in the env-file like it:
DEBUG=False
SECRET_KEY=<Your_some_long_string>
ALLOWED_HOSTS=<Your_host>
CSRF_TRUSTED_ORIGINS=https://<Your_host>
DB_ENGINE=django.db.backends.postgresql
DB_NAME=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=<Your_password>
DB_HOST=foodgram-db
DB_PORT=5432
  • Copy files from 'infra/' (on your local machine) to your server:
scp -r infra/* <server user>@<server IP>:/home/<server user>/foodgram/
  • Run docker-compose
sudo docker-compose up -d

Wait a few seconds... Your service is work! Иллюстрация к проекту

Enjoy your meal!

Oh, I'm sorry. You also need to create the first account for the admin panel using this command:

sudo docker exec -it app python manage.py createsuperuser

And if you want, you can use the list of ingredients offered by us to write recipes. Upload it to the database with the following command:

sudo docker exec -it foodgram-app python manage.py loaddata data/dump.json

Backend by:

Xewus