Flask skeleton for Google App Engine
Python
Switch branches/tags
Nothing to show
Pull request Compare This branch is 8 commits ahead, 7 commits behind blossom:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
submodules
.gitignore
.gitmodules
copy_skeleton.py
readme.md

readme.md

  • more simply

Motivation

We are currently migrating our projects from django to flask. Since we also intend to use flask for entirely new projects, it made sense to save on initial setup time. So we created a project skeleton which includes some of the things (libs and configuration) that we pick for most projects.

Components

General

here is a list of assembled components

  • flask decorators for (cache_page, login_required)
  • gae specific monkeypatch for werkzeug debugger http://dev.pocoo.org/projects/werkzeug/wiki/UsingDebuggerWithAppEngine
  • a simple user model
  • google appengine specific development/production environment switch
  • google appengine appstats configured
  • google appengine memcache caching backend configured
  • favicon.ico stub to avoid unneeded error logs
  • deck module with 26 char uuid generator
  • deck module with JsonProperty for the datastore
  • lib directory for external dependencies prepended to syspath

Libraries

Python

  • Flask
  • Jinja
  • werkzeug

Dependencies

General

Testing

Setup

clone repository

git clone https://github.com/utahta/flask-gae-skeleton.git <project_name>
cd flask-gae-skeleton

fetch all the submodules via

git submodule update --init

create a project

python copy_skeleton.py -t /path/to/project_name

set your own appengine application id in app.yaml

change the 'secret_key' in settings.py by generating a new one

initialize git

git init
git remote add origin <new_remote like git@github.com:your_name/project_name.git>
git commit -am "initial setup"
git push origin master

Usage

Run Application

Go to path "code" and run

dev_appserver.py .

Run Test Enviroment

Go to path "code" and run

nosetests-2.5 --with-gae tests/

Run Remote Console

Go to path "code" and run

python2.5 appengine_console.py <app-id>

TODO

things we still need to extract and clean up from other projects