- docker (20.10.5+): To install docker visit https://docs.docker.com/get-docker/
- docker-compose (1.25.5+): To install docker-compose visit https://docs.docker.com/compose/install/
To start project with Docker:
- install docker
- install docker-compose
- Clone the project
- Change directory to the project directory
- Run:
docker-compose up
- The application would be available at http://127.0.0.1:8000
To start project without Docker using virtualenv:
- Change directory to the project directory
- create a virtualenv
- activate the previously created virtualenv
- Run:
pip install -r <path_to_requirements.txt>
- Change directory to the directory of
manage.py
file - Run to makemigrations:
python manage.py makemigrations
- Run to migrate:
python manage.py migrate
- Run to runserver:
python manage.py runserver
- The application would be available at http://127.0.0.1:8000
Start a new app:
docker-compose run --rm emote_api sh -c "python manage.py startapp {app_name}"
Create superuser:
docker-compose run --rm emote_api sh -c "python manage.py createsuperuser"
Makemigrations:
docker-compose run --rm emote_api sh -c "python manage.py wait_for_db && python manage.py makemigrations"
To migrate:
docker-compose run --rm emote_api sh -c "python manage.py wait_for_db && python manage.py migrate"
To makemigrations and migrate:
docker-compose run --rm emote_api sh -c "python manage.py wait_for_db && && python manage.py makemigrations && python manage.py migrate"
To run test suites:
docker-compose run --rm emote_api sh -c "python manage.py wait_for_db && python manage.py test"
To run test coverage:
docker-compose run --rm emote_api sh -c "python manage.py wait_for_db && coverage run manage.py test && coverage report"
To check lint:
docker-compose run --rm emote_api sh -c "flake8"
To run tests and check lint:
docker-compose run --rm emote_api sh -c "python manage.py wait_for_db && python manage.py test && flake8"
To install new packages:
Add the package name to requirement.txt
file
then run
docker-compose up --build
To tear down the all containers:
docker-compose down
isort:
docker-compose run --rm emote_api sh -c "isort ."
API documentation for this project is available at: v1/api_docs/
API documentation schema for this project is available at: v1/api/schema/