A skeleton for creating Python applications using the Flask framework on App Engine
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 35 commits ahead, 4 commits behind googlearchive:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
config
controllers
forms
handlers
helpers
lib
models
services
templates
tests
.gitignore
LICENSE
README.md
app.yaml
appengine_config.py
index.yaml
nose.cfg
requirements-test.txt
requirements.txt

README.md

Hip Flask

Hip Flask forks the Google App Engine Flask Skeleton and adds a little more meat to its bone so that you can get a Flask project up and running on the App Engine platform even more quickly.

It is behind small projects like https://github.com/klenwell/decruiter and larger projects like http://forekarma.com.

Installation

  1. Install the App Engine Python SDK.

    See the README file for directions. You'll need python 2.7 and pip 1.4 or later installed too.

  2. Set up new project directory and clone this repo.

    mkdir my-new-project
    cd my-new-project
    git clone https://github.com/klenwell/hip-flask.git app-engine
    
  3. Install dependencies in project's lib directory.

    I recommend using a pyenv virtualenv.

    cd app-engine
    pyenv virtualenv 2.7.7 hip-flask
    pyenv local hip-flask
    

    Install dependencies:

    pip install -r requirements.txt -t lib
    
  4. Update config files.

    First copy the dist secrets file:

    cp -v config/secrets.py{-dist,}
    

    Then update config/__init__.py and config/secrets.py.

  5. Run local development server.

    cd my-new-project
    dev_appserver.py --port=8080 --admin_port=8081 --api_port=8082 ./app-engine
    

    Visit the application http://localhost:8080

    See the development server documentation for options when running dev_appserver.

Tests

First, install testing libraries:

cd my-new-project/app-engine
pip install -r requirements-test.txt

Then update nose.cfg settings, especially:

gae-lib-root=APP_ENGINE_PATH_HERE

To run tests:

cd my-new-project/app-engine
nosetests -c nose.cfg

With coverage:

nosetests -c nose.cfg --with-coverage --cover-erase \
  --cover-package=config,models

To run a single test:

nosetests -c nose.cfg tests/controllers/test_pages_controller.py

Deployment

  1. Use the Admin Console to create a project/app id. (App id and project id are identical).

  2. Deploy the application:

    appcfg.py update -A <your-app-id> -e <your-user-name> ./app-engine
    
  3. Congratulations! Your application is now live at your-app-id.appspot.com