Skip to content
GameCraft Website Mark III
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

GameCraft Site MK III

Written in Django. Why? Lots of plugins and docs.

Why not flask? Less plugins and seems to have stalled somewhat.


Free hosting with heroku, sooo much easier. If we need to scale up we can move to Digital Ocean, but that introduces deployment fu.


  1. Get a Heroku account
  2. Ask mick to get added to the gamecraft app
  3. Install the heroku toolbox
  4. heroku login
  5. git remote add heroku
  6. heroku fork gamecraft-it-yourname (e.g. gamecraft-it-micktwomey)
  7. profit

Ok, you can also create a virtualenv and pip install -r requirements.txt, but that's no fun.


  1. git commit
  2. git push origin master

This will trigger a build on which in turn pushes to Heroku. every push to origin/master triggers a deployment on successful test


  1. pip3.4 install -r requirements.txt
  2. npm install
  3. python3.4 test --settings=gamecraft.settings

Running the Code

If you want to run against the heroku db with your local code a neat trick is to eval the Heroku config variables.

In bash:

eval $(heroku config -a gamecraft-it-staging --shell | sed -E 's/^([A-Z0-9_]+=)(.*)/export \1"\2"/g')

In fish:

source (heroku config -a gamecraft-it-staging --shell | sed -E 's/^([A-Z0-9_]+)=(.*)/set -x \1 "\2"/g' | psub)

Running a local server against the Heroku db:

python3.4 runserver --settings gamecraft.settings_heroku_development


Node is required for some of the CSS and JS processing, install deps using npm install. They'll get installed into node_modules.

Config Files

There are a few settings files:

  • gamecraft.settings (base settings, use these for tests)
    • gamecraft.settings_heroku_base (core heroku settings)
      • gamecraft.settings_heroku (production heroku settings)
      • gamecraft.settings_heroku_development (local development with heroku db)
    • gamecraft.settings_local_development (local development with sqlite) covers getting these back into a sensible state again.

Copying Data

To copy data from the live site to staging:

heroku pg:copy --app gamecraft-it-staging gamecraft-it-eu::PURPLE HEROKU_POSTGRESQL_RED
You can’t perform that action at this time.