jaymes15 / emote_api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emote Care API

Written with Django and DRF

Requirements to run this project using Docker

Getting started

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

Project commands using docker

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

API documentation for this project is available at: v1/api_docs/ API documentation schema for this project is available at: v1/api/schema/

About


Languages

Language:Python 95.2%Language:Dockerfile 2.9%Language:Shell 1.9%