You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
djbeadle 064f936153 Minimum viable product 1 year ago
.vscode Minimum viable product 1 year ago
app Minimum viable product 1 year ago
tests Create 1 year ago
.gitignore Flesh out the example. 2 years ago Minimum viable product 1 year ago
conf.wsgi Create conf.wsgi 1 year ago Add testing configuration file 1 year ago Create 1 year ago
dev_data.sqlite3 Minimum viable product 1 year ago Imported the wrong environment variable! 😬 1 year ago
requirements.txt Update Werkzeug 1 year ago

Event Types:

  1. News that became public the day it happened
  2. News that became public AFTER it happened. This may be improtant enough to have a backdated post of type 3
  3. An event that only became public after the fact

Setting up the development environment

Prerequisites Python3 and Pip (install guide), virtualenv (install guide), and git (another install guide).

  1. Clone the repository

  2. Navigate to the repository's top level (the level with ‘’, ‘requirements.txt’, the folder ‘app’, etc)

  3. Create a virtual environment with python 3 and enter it (guide here)

  4. Install the required python packages from requirements.txt (guide here)

  5. Create a copy of ‘’ in the same directory called ‘’ and fill it in with your secrets. ‘’ already has an entry in ‘.gitignore’

  6. Set the Flask environment variables


export FLASK_ENV=development
export FLASK_APP=myapp

Windows CMD:

set FLASK_ENV=development
set FLASK_APP=myapp

Windows PowerShell:

  1. Run it!
flask run

Tips & Tricks & Notes

How do I run code on application startup?

Put it in /app/

How do I run this under Apache?

  1. Install Apache

  2. Install the appropriate version of mod_wsgi for your distribution and version of Python.

  3. Download this project and set it up based on the instructions in the previous section, Setting up the development environment

  4. Add an Apache virtual host with the following details

WSGIDaemonProcess fugue python-home=[PATH_TO_VIRTUALENV] home=[PATH_TO_PROJECT_HOME]
WSGIApplicationGroup %{GLOBAL}
    Options FollowSymLinks
    AllowOverride None
    Require all granted

Example variable values are as follows:

  • PATH_TO_VIRTUALENV: "/home/djbeadle/flask-template/venv/"
  • PATH_TO_PROJECT_HOME: "/home/djbeadle/flask-template”
  • PATH: “flask_template”
  • PATH_TO_CONF_WSGI: "/home/djbeadle/Daniel-fugue-take-home/conf.wsgi”
  • PROCESS_GROUP_NAME: “flask_template”
  1. Restart Apache and see if it works!

  2. Tweak your project's home directory permissions if Apache can't access it.

Build and Test

Tests can be run from the root directory with the command