I went through many tutorials and everything worked. But I started my own website and I get only error 404 not found.
I downloaded a HTML template and managed to clone the files from Github to PythonAnywhere. Right now the structure of my files is: Screenshot
Flask_app.py Code:
from flask import Flask
# set the project root directory as the static folder, you can set others.
app = Flask(flask_app, static_url_path='/home/dubspher/mysite')
app = Flask(__name__)
@app.route('/home/dubspher/mysite/')
def static_file(path):
return app.send_static_file(index.html)
if __name__ == "__main__":
app.run()
Should I create another website with templates and use render_template or there's a way I can request a static page with flask?
So far I tried many codes but I don't know what to do with static_url_path
HTML if needed : https://www.pythonanywhere.com/user/dubspher/shares/db715c9b9d7c43b7beb4245af23fb56c/
Let me know if I need to add more informations.