Skip to content

Commit

Permalink
How to run in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
norm committed Jul 28, 2021
1 parent 4829743 commit 93a4e5d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
30 changes: 30 additions & 0 deletions README.markdown
Expand Up @@ -5,6 +5,36 @@ A place to collection my tshirt wearing history.



## Generated static sites

Running in development:

# bring up the stack
export HASWORN_ENV=dev
./start

# if this is a new checkout, or volumes have been removed
./manage collectstatic --noinput
./manage migrate
DJANGO_SUPERUSER_PASSWORD=admin ./manage createsuperuser \
--username admin --email admin@example.com --noinput

To test a generated hasworn site:

./manage import_csv sample/norm.csv
./manage generate_site norm
( cd baked/norm && python -m http.server 8080 )


When done developing:

# shut down temporarily
./compose down

# shut down and remove volumes to start afresh (or when development stops)
./compose down --volumes


## Scripts

Scripts to interact with docker-compose, using the right configuration and
Expand Down
9 changes: 8 additions & 1 deletion manage
@@ -1,3 +1,10 @@
#!/usr/bin/env -S bash -euo pipefail

./compose run app python manage.py "$@"
declare -a env_vars

[ -n "${DJANGO_SUPERUSER_PASSWORD:-}" ] \
&& env_vars+=(-e DJANGO_SUPERUSER_PASSWORD=$DJANGO_SUPERUSER_PASSWORD)

./compose run \
"${env_vars[@]}" \
app python manage.py "$@"

0 comments on commit 93a4e5d

Please sign in to comment.