Have you tried
import app.mypackage
or
from app import mypackage
Or, from within views.py or mymodule.py, if you have done
from __future__ import absolute_imports
then try
import .mypackage
(There is a period before "mypackage" on that line.)
On Wed, Jun 19, 2013 at 2:51 PM, fred <[email protected]> wrote:
> I'm upgrading to django 1.5.1 on CentOs 6.4 with python 2.6.6 although
> I'm developing on a W7 with the django debug server.
>
> I am getting executing my view.py and most of the modules it uses. But in
> one scenario, the import fails, see directory outline below
>
> NewMdsServer
> |___NewMdsServer
> |___settings.py
> |___wsgi.py
> |___ ...
> |___app
> |___views.py
> |___mymodule.py
> |___mypackage
> |___ __init__.py
> |___ x.py
> |___ y.py
>
> I have code in the __init__.py which then imports x, y, etc
>
> I cannot seem to import mypackage from views or other modules at the same
> level. I've tried multiple variants as shown below and sys.path includes
> the directory above app.
> from app import mypackage -- "No module named mypackage"
> import mypackage -- "No module named ..
> import app.mypackage -- ditto
>
> The really strange thing is I could swear this was working last week
> before I got pulled off onto another project for a few days. I'm the only
> one using this server and I have root access. I've tried google, but
> cannot find a phrase that gives me anything useful. I would really
> appreciate some advice on what I'm doing wrong.
>
> Thanks,
>
> Fred.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.