Azure Flask Deployment - WSGI Interface

后端 未结 3 1931
南方客
南方客 2020-12-19 21:09

I\'m currently working through the book Flask Web Development, Developing Web Applications with Python and am currently having some issues determining where I should place t

3条回答
  •  情歌与酒
    2020-12-19 21:49

    After a bit of troubling shooting I was able to find a solution to my problem but was unfortunately unable to isolate exactly what went wrong.

    Basically I went through the process of rebuilding my test project from scratch in VS2015 (Python -> Azure Cloud Service -> Flask Web Role) and was somehow this time able to get a working solution using the 7a test project with it running in the Azure Emulator followed by successfully publishing it as an Azure Web App.

    I believe my problem could have resulted from one of the following issues:

    • The requirements.txt file was most likely not up to date. Note that when you run the Azure Simulator it checks the requirements.txt file and updates/installs any libraries that you don't currently have installed in your python environment automatically (without a prompt).
    • I possibly didn't have the ConfigureCloudService.ps1 or ps.cmd file in the bin folder in the Flask Worker Role Project. (It's also worthwhile reading through the Readme.mht file if you run into any problems)
    • I also changed the base of the manage.py file to:

      if __name__ == '__main__':
          app.run()
      

    Which may have helped as well.

    I hope this helps out anyone else who may run into a similar issue.

提交回复
热议问题