Successfully deployed flash application, but getting 404 when accessing the page

I was able to deploy the test bulb application in AWS using the instructions from this document http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_flask.html

status from "eb status" - green

Extraction of the status of the environment "helloflask-env" shows

==================================================== ================

URL: helloflask-env-m3mncmbmpv.elasticbeanstalk.com

Status: Ready

Health: Green

Environment Name: helloflask-env

Environment ID: e-mdp3jwtq9p

Solution Stack: Python Linux 64-bit running on Python

Version designation: git -05103eab3255781f58fdbaf1df8078aa4b008d4b-1369170804114

Date Created: 2013-05-21 10:45:25

Date updated: 2013-05-21 14:14:33

==================================================== ================

However, when I try to access the url helloflask-env-m3mncmbmpv.elasticbeanstalk.com, I get a 404 error with the following message:

Not found The requested URL / not found on this server. Apache / 2.2.22 (Amazon) Server on helloflask-env-m3mncmbmpv.elasticbeanstalk.com Port 80

Has anyone seen something like this? thanks!

+4
source share
2 answers

I understood the error in my case. This is due to a WSGIPath error.

The error occurred due to the fact that I have application.py in the app / folder. But since I ran the git.init command in my parent folder, EB errors come out because it cannot find the application.py file.

In short, the solution is to run "eb init" in the same place where you have the application.py file!

+5
source

I also had the same problem. I use flask 0.10 and now it works fine.

from an example

from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" if __name__ == "__main__": app.run() 

to

 from flask import Flask application = Flask(__name__) # Change assignment here @application.route("/") # Change your route statements def hello(): return "Hello World!" if __name__ == "__main__": application.run() # Change all other references to 'app' 

The link will help you.

+6
source

Source: https://habr.com/ru/post/1482289/


All Articles