My project includes several django programs that should be used in a different way, possibly on different machines. However frequently these applications from time to time have to access each other peoples models, so I believed of "externalizing" my models to ensure that they may be utilized more stylishly from the application. Therefore the idea would be to will have directory structure resembling something similar to this:
/ + application1 + application2 + models
It is possible to functional indicate doing that (apart from code maintainability), because the programs can mix-reference one another?
The next paragraph within the django book makes me believe that that's most likely not recommended (I added the bold formatting):
However, there’s one requirement concerning the application convention: if you are using Django’s database layer (models), you have to produce a Django application. Models must live within applications. Thus, to be able to start writing our models, we’ll need to produce a new application.
The next did not fit well within the comments to @jcollado's answer so I'll place it here:
Models across files
It's perfectly OK to relate one to 1 from another application. To get this done, import the attached model towards the top of the model that holds your model. Then, just make reference to another model class wherever needed. For instance:
from geography.models import ZipCode class Restaurant(models.Model): # ... zip_code = models.ForeignKey(ZipCode)
I do not think this can be a particularly wise decision, though I can tell the appeal. You'll be including lots of models you are not using should you only want your applications installed. I believe it is best to keep models inside the application they most connect with.
This could make while using admin interface more confusing. Where would you register the models using the admin? Where is the next step the admin personalization for any model?