Skip to content

Instantly share code, notes, and snippets.

@vegaro

vegaro/terrain.py

Forked from scastillo/terrain.py
Last active Dec 20, 2015
Embed
What would you like to do?
Lettuce's Terrain.py for Django + Google App Engine
import logging
import os
# Add appengine stuff to path
import dev_appserver as script
script.fix_sys_path()
from google.appengine.api import yaml_errors
from google.appengine.tools import dev_appserver
from google.appengine.tools import dev_appserver_main as main
#root of the project
#TODO: Little coupled here, find a better way
root_path = os.path.dirname(__file__)
# default options
option_dict = main.DEFAULT_ARGS
# load configuration yaml
config = None
try:
config, matcher, from_cache = dev_appserver.LoadAppConfig(root_path, {})
except yaml_errors.EventListenerError, e:
logging.error('Fatal error when loading application configuration:\n' +
str(e))
dev_appserver.SetupStubs(config.application, **option_dict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment