Re: How do I import a module in a subdirectory of an app?

2006-06-24 Thread James Bennett
On 6/24/06, Andrew <[EMAIL PROTECTED]> wrote: > import mysite.myapp.testdir.foo doesn't work. Why? Via IRC, we were able to help Andrew figure out he needed to add an __init__.py in the directory he wanted to import from; roughly speaking, this tells Python that the directory is a module from

How do I import a module in a subdirectory of an app?

2006-06-24 Thread Andrew
Say I have a file structure like this: mysite myapp __init__.py models.py views.py testdir foo.py import mysite.myapp.testdir.foo doesn't work. Why? Is testdir not in my pythonpath? Am I missing something? Thanks in advance.