Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Boilerplate project template for running Flask on Google App Engine
Python JavaScript CSS
Tree: dd3525822c

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Flask on App Engine Project Template

Boilerplate project template for running a Flask-based application on Google App Engine (Python)

About Flask

Flask is a BSD-licensed microframework for Python based on Werkzeug, Jinja 2 and good intentions.

See for more info.


  1. Download this repository via git clone or download the tarball at
  2. Copy the src/ folder to your application's root folder
  3. Set the application id in src/app.yaml
  4. Configure datastore models at src/application/
  5. Configure application views and URL routes at src/application/
  6. Configure forms at src/application/
  7. Add a file at src/application/, with the following contents:

where the keys are a randomized string of characters

or, run the script at src/application/ to generate the keys file

Front-end Customization

  1. Customize the main HTML template at src/application/static/templates/base.html
  2. Customize CSS styles at src/application/static/css/main.css
  3. Add custom JavaScript code at src/application/static/js/main.js
  4. Customize favicon at src/application/static/img/favicon.ico
  5. Customize 404 page at src/aplication/templates/404.html

Testing the Application

To test the application using App Engine's development server, use src/

Assuming the latest App Engine SDK is installed, the test environment is available at http://localhost:8080

Deploying the Application

To deploy the application to App Engine, use update update src/

The application should be visible at http://{YOURAPPID}

Folder structure

The App Engine app's root folder is located at src/.

    |-- application (application code)
    |-- flask (flask core)
    |-- flaskext (flask extensions, inc. Flask-WTF)
    |-- jinja2 (template engine)
    |-- simplejson (required by Jinja2)
    |-- werkzeug (WSGI utilities for Python-based web development)
    `-- wtforms (Jinja2-compatible web form utility)

The application code is located at src/application.

    |-- (initializes flask app)
    |-- (decorators for URL handlers)
    |-- (web form models and validators)
    |-- (App Engine datastore models)
    |-- (settings for flask app)
    |-- static
    |   |-- css
    |   |   |-- main.css (custom styles)
    |   |   `-- style.css (base CSS from HTML5 boilerplate)
    |   |-- img
    |   |   |-- favicon.ico (replace with custom favicon)
    |   |   `-- favicon.png
    |   `-- js
    |       |-- main.js (custom javascript)
    |       `-- modernizr-1.5.min.js (HTML5 enabling and detection)
    |-- templates
    |   |-- 404.html (not found page)
    |   |-- base.html (master template)
    |   |-- list_examples.html (example list-based template)
    |   `-- new_example.html (example form-based template)
    |-- (unit tests)
    `-- (URL routes and handlers)


Project template layout was heavily inspired by Francisco Souza's gaeseries flask project

HTML5-based main template (templates/base.html) and base CSS styles (static/css/style.css) extracted from HTML5 Boilerplate

Something went wrong with that request. Please try again.