Your WSGIPath refers to a file that does not exist

后端 未结 5 1805
温柔的废话
温柔的废话 2020-12-09 01:16

I\'m trying to upload my Flask application to AWS however I receive an error on doing so:

Your WSGIPath refers to a file that does not exist.

5条回答
  •  [愿得一人]
    2020-12-09 01:24

    If anyone here is doing via AWS Console (GUI), modify the configuration and put your script name in WSGIPath as below.

    I'm giving bonus hints if you are newer.

    • You should match the script name and the Flask object too.
    • Common mistake: When you're compressing the source code, you need to select the files and compress, not the folder. (make sure you have the .py in the root of the zip)
    from flask import Flask
    application = Flask(__name__)
    
    @application.route("/")
    def hello():
        return "Hello"
    
    if __name__ == "__main__":
        application.run()
    

提交回复
热议问题