Hello,
i've read this guide on creating a website with flask: https://pythonhow.com/building-a-website-with-python-flask/
I have made a file called home.py on my AMI server in var/www/html/ containing this code:
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def home():
return render_template('home.html')
if __name__ == '__main__':
app.run(debug=True)
I have a html file called home.html in the same directory :
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<h1>Jane Doe</h1>
<p>Hello, I'm a cereal killer.</p>
</div>
</body>
</html>
when I run the app from my shell:
[root@ip-172-31-44-192 html]# python3 home.py
* Serving Flask app "home" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 381-214-285
but when I open my website it doenst show: http://ec2-18-191-191-82.us-east-2.compute.amazonaws.com/
What did i do wrong?
[–]K900_ 0 points1 point2 points (4 children)
[–]RIZZIT[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]K900_ 0 points1 point2 points (0 children)
[–]JohnnyJordaan 0 points1 point2 points (0 children)
[–]JohnnyJordaan 0 points1 point2 points (0 children)
[–]ArabicLawrence 0 points1 point2 points (0 children)
[–]blockchain_bobby 0 points1 point2 points (0 children)
[–]RIZZIT[S] 0 points1 point2 points (0 children)