Import from packages __init__
<p>I got problem I'm not able to fix although I tried almost everything I know or could read somewhere else.</p>

<p>I got a package with this structure:</p>

<pre><code>/project_top
    __init__.py
    run_server.py
    /project
        __init__.py
        /apps
            __init__.py
            /wiki
                __init__.py
                views.py
                models.py
        .
        .
</code></pre>

<p>In <code>/project/__init__.py</code> is my basical project. The application is created there as well as my db object (SQLAlchemy).
In <code>run_server.py</code> <code>project.app</code> and <code>project.db</code> are imported without any problem, of course. Now i need the db object in my views and models again. So in <code>views.py</code> and <code>models.py</code> i try: </p>

<pre><code>from project import db
</code></pre>

<p>I kind of tried to get the db object somehow in many ways by *-impost and some stuff. Relative importing also failed in every possible way what was the most weird thing about it all.
As the views.py and models.py file are inside the package I added <code>'/.../project_top'</code> to my python path - but it still doesn't work. This makes me wonder as I tried this in my shell.</p>

<p>Starting in <code>/../wiki</code> with the shell makes project.db not being available of course. After adding the named pythonpath everything was working fine with the import. Basically I do the same in my project where this is not working.</p>

<p>After many hours I just can guess that it's something that so extremly simple that it's not even listed anywhere.</p>

<hr>

<p>Little Edit:
With nils tip I can import <code>project</code> now in <code>views.py</code> and <code>models.py</code> but it seems he can't find <code>project.db</code>:</p>

<pre><code>ImportError: No module named db
</code></pre>

<p>In shell it's still no problem.</p>
