Skip to content
GameCraft Website Mark III
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
gamecraft
.gitignore
Dockerfile
LICENSE
Makefile
Procfile
README.md
circle.yml
manage.py
manage_development.py
package.json
requirements.in
requirements.txt
runtime.txt

README.md

GameCraft Site MK III

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

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

Hosting

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

Development

  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 git@heroku.com:gamecraft-it-eu.git
  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.

Deployment

  1. git commit
  2. git push origin master

This will trigger a build on https://circleci.com/gh/micktwomey/gamecraft-mk-iii which in turn pushes to Heroku. every push to origin/master triggers a deployment on successful test

Testing

  1. pip3.4 install -r requirements.txt
  2. npm install
  3. python3.4 manage_development.py 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 manage.py runserver --settings gamecraft.settings_heroku_development 0.0.0.0:8000

Node

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)

https://github.com/micktwomey/gamecraft-mk-iii/issues/2 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.