- 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
this will output
docker compose run --rm app sh -c "python manage.py wait_for_db && python manage.py migrate"
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"
-
Notifications
You must be signed in to change notification settings - Fork 0
Roboman341/recipe-app-api
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published