A book-keeping app for the solo-journaling RPG, Thousand Year Old Vampire.
- Docker Compose
- Yarn
- Visual Studio Code
- Python 3.9.7
$ docker-compose up --build
$ docker-compose exec web python manage.py migrate
$ docker-compose exec web python manage.py createsuperuser
Create a .env
file in the project root using the .env.template
file.
$ cp .env.template .env
Copy the environment values from the web
container in docker-compose.yaml
to the corresponding variables in .env
.
Prepare the prompt file and then use the import_prompts
command to import it into the database. See Prompt File Format for instructions on formatting the prompt file.
$ python manage.py import_prompts path/to/prompts.txt
$ cd web
$ yarn start
Your default web browser should open to http://localhost:3000/
IMPORTANT: Make sure to build and commit the frontend static files with yarn build
prior to deploying your changes.
$ heroku login
$ heroku create <app>
$ heroku stack:set container -a <app>
$ heroku addons:create heroku-postgresql:hobby-dev -a <app>
$ heroku git:remote -a <app>
$ git push heroku main
Go to dashboard.heroku.com/apps/<app>/settings
, then click "Reveal Config Vars".
Add the following config variables:
ALLOWED_HOSTS=<app>.herokuapp.com
DEBUG=false
SECRET_KEY=<key>
A secret key can be generated with the following command:
$ python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
The DATABASE_URL
variable should already be populated by Heroku.
$ heroku run python manage.py migrate
$ heroku run python manage.py createsuperuser
You will first need to configure .env
with the values from Heroku in step 2 in order to connect to the deployed database.
$ python manage.py import_prompts path/to/prompts.txt