Skip to content

Commit aba472c

Browse files
Added devcontainer commands
1 parent efd6da1 commit aba472c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ wipe-sqlite-db: # Delete's the project database
2727
serve: # Run the project locally
2828
python manage.py runserver ${local_config}
2929

30+
serve-gunicorn: # Run the project using Gunicorn
31+
gunicorn config.wsgi:application -c gunicorn.conf.py
32+
3033
test: # Run tests
3134
python manage.py test ${local_config}
3235

@@ -81,6 +84,23 @@ docker-prod:
8184

8285
docker-setup: docker-up docker-migrate docker-build-db # (Docker) Start services, prepare the latest DB schema, populate the DB
8386

87+
devcontainer-migrate: # (Dev Container) Run any pending migrations
88+
python manage.py migrate ${docker_config}
89+
90+
devcontainer-build-db: # (Dev Container) Build the database
91+
sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}'
92+
93+
devcontainer-make-migrations: # (Dev Container) Create migrations files if schema has changed
94+
python manage.py makemigrations ${docker_config}
95+
96+
devcontainer-flush-db: # (Dev Container) Removes all the data present in the database but preserves tables and migrations
97+
python manage.py flush --no-input ${docker_config}
98+
99+
devcontainer-shell: # (Dev Container) Launch an interative Django shell for the pokeapi app
100+
python manage.py shell ${docker_config}
101+
102+
devcontainer-setup: dev-install devcontainer-migrate devcontainer-build-db # (Dev Container) Install requirements, prepare the latest DB schema, populate the DB
103+
84104
format: # Format the source code
85105
black .
86106

0 commit comments

Comments
 (0)