Skip to content

Instantly share code, notes, and snippets.

@b4oshany
Created September 28, 2015 06:15
Show Gist options
  • Save b4oshany/350305ef729fcc70fda1 to your computer and use it in GitHub Desktop.
Save b4oshany/350305ef729fcc70fda1 to your computer and use it in GitHub Desktop.
Flask mod_wsgi debug mode
import config
from flask import Flask
app = Flask(__name__)
app.config.from_object(config)
# Jinja2 templates commenting tags
app.jinja_env.line_statement_prefix = '#'
app.jinja_env.line_comment_prefix = '##'
@app.route("/")
def main():
return "Welcome to test."
##
## !/usr/bin/python
main_folder = "/path/to/FlaskApp/"
activate_this = main_folder + "temp/bin/activate_this.py"
execfile(activate_this, dict(__file__=activate_this))
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, main_folder)
from run import app
from werkzeug.debug import DebuggedApplication
app.secret_key = '6E&-kh(f>Hq|?|WCHPlSU!B>vm!'
application = DebuggedApplication(app, evalex=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment