Re: Share models between django apps

387 views
Skip to first unread message
Message has been deleted

Xavier Ordoquy

unread,
Aug 6, 2012, 8:01:54 AM8/6/12
to django...@googlegroups.com
Hi,

Le 6 août 2012 à 13:53, Ivo Marcelo Leonardi Zaniolo <imarc...@gmail.com> a écrit :

I'm having problems share models between 3 different apps.
The models that I share the common app.

example:
project /
common / models.py
app1/models.py -> import from common.models
app2/models.py -> import from common.models

If I configure the application and only the most common one
app, I have no problems "INSTALLED_APPS (" common "," app1 ")."
Have to add the two applications that reference the application
common settings on my second application does not encounter
models defined in "common".
I've tried changing the order of configuration INSTALLED_APPS
But it still fails.

Thanks for the help

Do you have a common directory or common.py in the app2 directory ?

Regards,
Xavier Ordoquy,
Linovia.

Message has been deleted
Message has been deleted

Rajeesh Nair

unread,
Aug 6, 2012, 12:37:03 PM8/6/12
to django...@googlegroups.com


Hi,

Please clarify what exactly is the failure. Is it raising ImportError?
Then, Try "import from project.common.models" instead of "common.models".

Rajeesh.
Message has been deleted

Rajeesh Nair

unread,
Aug 6, 2012, 1:47:16 PM8/6/12
to django...@googlegroups.com


Checked for any circular import between these apps also? I guess you already know such possibilities. Just asking to make sure.

Rajeesh.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages