-
-
Save vegaro/6057147 to your computer and use it in GitHub Desktop.
Lettuce's Terrain.py for Django + Google App Engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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