mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-24 16:20:59 +00:00
Add Makefile targets for some common/useful development tasks (#358)
This commit is contained in:
parent
4276260c2e
commit
f16dcd04e4
2 changed files with 46 additions and 1 deletions
41
Makefile
41
Makefile
|
@ -14,3 +14,44 @@ compose_up:
|
|||
|
||||
compose_down:
|
||||
docker-compose -f docker/docker-compose.yml down
|
||||
|
||||
# Development Setup
|
||||
.venv:
|
||||
python3 -m venv .venv
|
||||
. .venv/bin/activate
|
||||
python3 -m pip install -r requirements-dev.txt
|
||||
|
||||
.git/hooks/pre-commit: .venv
|
||||
python3 -m pre_commit install
|
||||
|
||||
.env:
|
||||
cp development.env .env
|
||||
|
||||
_PHONY: setup_local
|
||||
setup_local: .venv .env .git/hooks/pre-commit
|
||||
|
||||
_PHONY: startdb stopdb
|
||||
startdb:
|
||||
docker compose -f docker/docker-compose.yml up db -d
|
||||
|
||||
stopdb:
|
||||
docker compose -f docker/docker-compose.yml stop db
|
||||
|
||||
_PHONY: superuser
|
||||
createsuperuser: setup_local startdb
|
||||
python3 -m manage createsuperuser
|
||||
|
||||
_PHONY: test
|
||||
test: setup_local
|
||||
python3 -m pytest
|
||||
|
||||
# Active development
|
||||
_PHONY: migrations server stator
|
||||
migrations: setup_local startdb
|
||||
python3 -m manage migrate
|
||||
|
||||
runserver: setup_local startdb
|
||||
python3 -m manage runserver
|
||||
|
||||
runstator: setup_local startdb
|
||||
python3 -m manage runstator
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
TAKAHE_DATABASE_SERVER="postgres://postgres@localhost/takahe"
|
||||
# docker-hosted postgres
|
||||
TAKAHE_DATABASE_SERVER="postgres://postgres:insecure_password@localhost:5433/takahe"
|
||||
# If you are using a locally-hosted postgres you can comment the above
|
||||
# and uncomment the following line
|
||||
# TAKAHE_DATABASE_SERVER="postgres://postgres@localhost/takahe"
|
||||
TAKAHE_DEBUG=true
|
||||
TAKAHE_SECRET_KEY="insecure_secret"
|
||||
TAKAHE_CSRF_TRUSTED_ORIGINS=["http://127.0.0.1:8000", "https://127.0.0.1:8000"]
|
||||
|
|
Loading…
Reference in a new issue