So I am just starting a project in flask and I am using the proper folder structure for the first time and I keep getting this error. I am confused as to why and haven't faced this problem before.
I have tried renaming files and using from . import views but to no avail.
app.py
from flask import Flask
from app import views
app = Flask(__name__)
views.py
from app import app
@app.route('/')
def index():
return "Hello World!"
run.py
from app import app
app.run(debug=True)
Folder structure:
app
static
templates
app.py
run.py
views.py
tmp
Traceback (most recent call last): File "app.py", line 2, in from app import views File "/Users/Josh/PycharmProjects/web1/app/app.py", line 2, in from app import views ImportError: cannot import name 'views'