This is a RESTful API for "YaMDb", a rating service for artworks like movies, books or songs.
DB_ENGINE=foo
DB_NAME=fooo
POSTGRES_USER=fooo
POSTGRES_PASSWORD=foooo
DB_HOST=db
DB_PORT=5432
DJANGO_SECRET_KEY='foooo'
DJANGO_ALLOWED_HOSTS=*
- clone this repository to your local machine
git clone git@github.com:user-Roma/yamdb_final.git
- create a virtual environment
python3 -m venv venv
- activate virtual environment
source venv/bin/activate
- upgrade pip
python3 -m pip install --upgrade pip
- install dependencies in requirements.txt
pip install -r api_yamdb/requirements.txt
- inside the folder with manage.py file execute the following command for migrations:
python3 manage.py migrate
- inside the same folder execute this command to create a superuser:
python3 manage.py createsuperuser
- inside the same folder execute this command to start the development server:
python3 manage.py runserver
- run docker
sudo systemctl start docker
- create and start containers from the directory ./infra/
sudo docker-compose up --build
- run migrations
sudo docker-compose exec web python manage.py makemigrations
sudo docker-compose exec web python manage.py migrate
- collect the static files
sudo docker-compose exec web python manage.py collectstatic --no-input
- OPTIONAL: copy test data to remote server from the directory ./infra/
sudo scp test_database.json cloud-touch-01@130.193.41.106:/home/cloud-touch-01/
- OPTIONAL: copy test data into docker container
sudo docker cp test_database.json <CONTAINER>:app/test_database.json
- OPTIONAL: load test database into yamdb project
sudo docker-compose exec web python manage.py loaddata test_database.json
- create superuser
sudo docker-compose exec web python manage.py createsuperuser
After you started the development server, go to http://130.193.41.106/api/redoc/ URL where you can find the API documentation with available endpoints.
RomanS, AlexanderK, RomanY