Skip to content

Учеба без голода! Проект для Яндекс Специализации Django

Notifications You must be signed in to change notification settings

MLGRussianXP/foosh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foosh

Учеба без голода! Не трать время на очереди - заказывай еду онлайн!

Prod

Install Python, copy the repo, setup the venv, install requirements and create a database:

git clone https://gitlab.crja72.ru/django/2024/spring/course/projects/team-4.git
cd team-4
python -m venv venv
source venv/bin/activate
pip install -r requirements/prod.txt
cp .env-example foosh/.env
cd foosh
python manage.py migrate

Load cities from fixtures:

python manage.py cities_light_fixtures load --base-url file:fixtures/cities_light/

Setup a test YooKassa shop. Follow the instruction: https://yookassa.ru/docs/support/merchant/payments/implement/test-store. Then, set the corresponding variables in .env file: YOOKASSA_SHOP_ID and YOOKASSA_API_KEY. YOOKASSA_SUCCESS_URL is going to be your_domain/auth/profile/menu. Also, add your domain to DJANGO_ALLOWED_HOSTS. Check the HTTP notifications tab. Pass the your_domain/cart/order_update/ to the URL for notifications. Enable only payment.succeeded and payment.canceled.

Setup Captcha. Get your API keys here. Make sure to select V2 captcha. Set RECAPTCHA_PUBLIC_KEY and RECAPTCHA_PRIVATE_KEY in .env file.

Check other variables in .env file. Specify them according to your project.

Run the server:

python manage.py runserver

Dev

Setup everything like in Prod section, but install dev requirements:

pip install -r requirements/dev.txt

To use YooKassa, firstly, setup ngrok and pass the URL to DJANGO_ALLOWED_HOSTS and DJANGO_CSRF_TRUSTED_ORIGINS in .env file.

And have a good time!

  • To dump cities, use:
python manage.py cities_light_fixtures dump

And copy result from venv/Lib/site-packages/cities_light/data/fixtures/ to fixtures/cities_light/.

Test

Setup everything like in Dev section, but install test requirements:

pip install -r requirements/test.txt

To run the tests:

python manage.py test

To check linting and code style (run this command from the root of the project):

flake8 .

About

Учеба без голода! Проект для Яндекс Специализации Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •