Skip to content

Roboman341/recipe-app-api

Repository files navigation

recipe-app-api

notes

  • configure docker hub with access token for github project
  • to run flake8 testing:
    docker compose build
    docker compose run --rm app sh -c "flake8"
  • initialize the project inside app directory using django cli (the files are synced between the container and our app folder):
    docker compose run --rm app sh -c "django-admin startproject app ."
  • run and see in the browser:
    docker compose up
  • run tests
    docker compose run --rm app sh -c "python manage.py test"
  • create core app to configure our application to wait postgresql db until it starts
    docker compose run --rm app sh -c "python manage.py startapp core"
  • create migrations for the custom user model that we added to the project. do not modify the migration file (0001_initial.py)
    docker compose run --rm app sh -c "python manage.py makemigrations"
  • apply the migrations to the project
    docker compose run --rm app sh -c "python manage.py wait_for_db && python manage.py migrate"
    this will output Migration admin.0001_initial is applied before its dependency core.0001_initial on database 'default'. because we applied the migrations previously with default django user model. We need to clear the data in db.
    docker volume ls
    docker volume rm recipe-app-api_dev-db-data
    docker compose run --rm app sh -c "python manage.py wait_for_db && python manage.py migrate"
  • create django superuser
    docker compose run --rm app sh -c "python manage.py createsuperuser"
  • create user app
    docker compose run --rm app sh -c "python manage.py startapp user"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published