flask-app
|_ app.py
|_ views.py
|_ models.py
|_ resources.py
~ app.py
from flask import Flask
app = Flask(__name__)
import views, models, resources
if __name__ == '__main__':
app.run(debug=True)
~ views.py
from app import app
@app.route('/')
def index():
home = "<h1>Welcome</h1>"
return home
For some reason I get a 404 not found error when I try to access localhost:5000.
Read this answer (Can't route to "/login" with flask?) but I doubt it has anything to do with trailing slashes.
When I paste the route back into app.py it starts working again. Why is this? How can I fix my flask app? Would appreciate any help.