E
E
EazyE2016-09-21 16:31:32
Flask
EazyE, 2016-09-21 16:31:32

Import from init parent directory. Why am I getting an ImportError?

Hello!
I want to say right away that I am new to Python. Prior to that I was programming in PHP. I decided to do a new project on the Flask framework. It is known that the architecture of a Flask project can be done in any way, but I decided to look for how people do it in general and found this description https://www.digitalocean.com/community/tutorials/h... . I liked it and started to do according to this example.
Here's what we have:
0e7a3275364941d2882d9031d41f9963.png
I think that everything is visible on the screenshot and comments are not needed. Help, please, stuck at this point.
Link to the screenshot separately: https://habrastorage.org/files/0e7/a32/753/0e7a327... .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EazyE, 2016-09-22
@EazyE

Problem solved like this:
The line "from app.home.controllers import home" from __init__ is omitted below. Now it is located under "db = MongoEngine(app)" and everything works.
If anyone knows why this is so, please explain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question