开发者

How to move logic from appengine_config.py file on Google App Engine (Python)?

I have used file appengine_config.py in root of my project directory. This f开发者_如何学JAVAile contains next code:

import os
from google.appengine.ext.appstats import recording
from gae.sessions import SessionMiddleware
import gae.webapp

COOKIE_KEY = 'my_private_key_used_for_site_%s' % os.environ['APPLICATION_ID']

def webapp_add_wsgi_middleware(app):
    app = SessionMiddleware(app, cookie_key=COOKIE_KEY, cookie_only_threshold=0)
    app = recording.appstats_wsgi_middleware(app)
    return app

This code helps me enable cookies and App Stats for my application.

I need to delete this file, and move this logic to file into separate package. I need to clear project root directory. It is possible?


Try deploying an empty appengine_config.py file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜