cgarcia Posted December 5, 2017 Share 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" Quote Link to comment Share on other sites More sharing options...
Krydos Posted December 5, 2017 Share 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 Quote Link to comment Share on other sites More sharing options...
cgarcia Posted December 5, 2017 Author Share Posted December 5, 2017 Thanks, it worked ok.It was very simple. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.