You can completely eliminate Django from your thinking about the
problem. This is a pure Python question.

A Python file being within a Django project changes nothing about how
Python imports code. Either you're importing something on your Python
path or you're doing a relative import. If your import is failing,
then just import it using its full location on the PYTHONPATH.

The only other consideration is if your code isn't anywhere on your
PYTHONPATH, in which case all you need to do is add it. You can add it
to sys.path in your code, but my preference is to use virtualenv for
every project and put my project path in my PYTHONPATH that way.

You can easily do it from the command line manually first just to make
sure it works. Something like:

    export PYTHONPATH=$PYTHONPATH:/path/to/my/code

Then run your code and make sure it works. When you have it working,
do something more permanent. I recommend the virtualenv method.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to