Flask-Web-App-Tutorial
Flask-Web-App-Tutorial copied to clipboard
Problem with from .import db
In models.py, when I run from . import db, I get the error ImportError: attempted relative import with no known parent package. Both init.py and models.py are inside the folder website. I can't find the solution anywhere, I've tried several things but none work. Please help!
I get the same error when I run the file. However, if I run main.py then there is no issue. I believe you are not supposed to run auth.py and models.py directly.
Yes, you are not supposed to run anything with a from . import <insert here>
. Someone should close this issue now.