[Answer]-Call an external app's view in Django

1👍

✅

Forget about get_app(), you just need to get your directory structure and import paths working properly.

It sounds like you’re saying that the problem is that the local publications.py is shadowing the publications app? You must be on Python 2, then, since this ambiguity is no longer possible in Python 3. To remove the ambiguity in Python 2, add from __future__ import absolute_import to the top of the file. Once you do that, from publications import ... will always refer to the top-level app. To access the local publications.py you’ll use either from .publications import ... or from myapp1.models.publications import ....

See PEP 328 if you want to learn more about the absolute / relative import issue.

Leave a comment