Skip to content

Examples

Noah S. Roberts edited this page Nov 16, 2024 · 2 revisions

Admin

At the start of a new term

  1. Remove old term(s) (optional)
rm -r /django/spring24
# or, to remove multiple at a time
rm -r /django/{fall23,spring24} # don't include quotation marks!
  1. Create new term
mkdir /django/fall24
  1. Add groups to that term
create-group fall24 group1
# or, to create multiple at a time
create-group fall24 "group{1..3}" # include quotation marks!
# "{1..3}" means "1 to 3" (inclusive start and end) in Bash

Working with the shared Traefik stack

  1. cd to /django/source
  2. Run deploy (usage) in this folder. It should recognize the presence of 'docker-compose.traefik.yml' and let you interact with it.

Groups

Starting the project

  1. Navigate to your group's folder with cd.
cd /django/fall24/group1

Warning

If you were going to clone your repo, stop. The next step handles that for you. WDH (this thing) expects a very specific file and folder structure to work, so it's easier if you let it clone your repo itself.

  1. Before doing anything else, Prepare your group's folder. Do not skip this step! You will not be able to start your group's Docker Compose stack (defined in docker-compose.site.yml) until you run this.
deploy prep
# it'll walk you through a few steps to get your folder set up, including cloning your repo for you.
  1. Start the stack!
deploy start site
  1. You'll need to set up a superuser now, as this deployment uses a PostgreSQL (or just Postgres) server that was literally just started in step 3. Thankfully, with deploy, it's super easy. Use deploy manage in place of python manage.py and run commands as normal.
deploy manage createsuperuser

Running commands

If you just need to run commands with 'manage.py', use

deploy manage

in its place.

If you need to run commands in the terminal, a less friendly syntax is needed. For example, to check if the Postgres container is running and Postgres itself is ready, you would run:

deploy exec site postgres -u pguser -d pgdb -h localhost
Clone this wiki locally