cgarcia Posted December 5, 2017 Posted December 5, 2017 Hello. someone knows, how to debug an application flask in python this is my code /home/cgarciar/public_html/flask/myapp.py #! /usr/bin/python3.6 import sysfrom flask import Flask#, __version__app = Flask(__name__)application = app @app.route("/")def hello(): return "Hello world!" @app.route("/flask/version/")def p_version(): return "Flask version %s" % __version__ if __name__ == "__main__": app.run() and file : /home/cgarciar/public_html/flask/flask.wsgi #! /usr/bin/python3.6 import sysimport ossys.path.append('/home/cgarciar/public_html/flask')os.path.insert(0,os.path.dirname(__file__))from myapp import app as application# make the secret code a little betterapplication.secret_key = 'secret' with permission 755 y result see "http://www.cesly.heliohost.org/flask/flask"
Krydos Posted December 5, 2017 Posted December 5, 2017 os.path.insert(0,os.path.dirname(__file__))And the wiki says sys.path.insert(0, os.path.dirname(__file__))Source: http://wiki.helionet.org/Flask
cgarcia Posted December 5, 2017 Author Posted December 5, 2017 Thanks, it worked ok.It was very simple.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now