Created
September 28, 2015 06:15
-
-
Save b4oshany/350305ef729fcc70fda1 to your computer and use it in GitHub Desktop.
Flask mod_wsgi debug mode
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 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." |
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
## | |
## !/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