librelist archives

« back to archive

Issue with importing and Blueprints

Issue with importing and Blueprints

Willy Cordeiro
2012-07-02 @ 00:17
I'm trying to import my database object in one of my Blueprints but I'm
having trouble getting this to work.
Here's my code.

But here is the most relevant code.
This is my for my top level app
and then this is the file within my registration blueprint.

I'm not quite sure what's wrong with the code. Sublime Text 2 is able to
follow the import statement and code complete.
But when I try to enter my interactive shell and import a Model this is the

>>> from skyroket.registration import User
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "skyroket\", line 10, in <module>
    from skyroket.registration import auth as auth_blueprint
  File "skyroket\registration\", line 6, in <module>
    import urls
  File "skyroket\registration\", line 2, in <module>
    from . import views
  File "skyroket\registration\", line 3, in <module>
    from .models import User
  File "skyroket\registration\", line 1, in <module>
    from skyroket import db
ImportError: cannot import name db

How should I correct this?

-Wellington "Willy" Cordeiro