2 django projects importing one model from one to another

My Django 1.2 setup works through mod_wsgi under Debian Lenny.

I have this structure:

/root/
    project1/appx
                 models.py
    project2/appy
                 models.py
                 management/
                           commands/
                                   mycommand.py

Now I want to import the Foox model from project1 to project2.

What would be the easiest solution WITHOUT moving the entire project to Python_path? I especially need a solution without using mod_wsgi, because I will import this model from project1 into a custom manage.py command called "mycommand" in project2?

+5
source share
2 answers
import sys
sys.path.append('/root/project1')
from appx.models import Foox
+8
source

What about:

$ cd /root/project2
$ ln -s ../project1/appx

?

0
source

All Articles