Thursday, 15 August 2013

Split big apps in django -


I have an app that is growing very large, doing a lot as a single app, so I want / I want to divide it into 2 or 3 sub-apps

The problem is that there are a dozen models that are connected to each other (forearm key, many tomatomendils, etc.)

I have read many times that the app should be self-consistent, so, is it possible to separate a big app in many people connected to each other Areas are no best practices for?

-> How is the model importing bad from other apps?

I have not heard of the best practice solution, but here's what I usually do , And I split a lot of apps:

Step 0 - When is an app "huge" ?:

An app should be an (independent) logical unit. Independent is truly misleading, you can definitely get dependency such as django.conrib.auth , what you should have done cross dependence is being said that they will eventually loop to import That is, the app can be quite big, together with perfectly fine. If you have problems organizing your code, then I can remind you of the fact that each module can be made in the form of a package, you can set your models.py to Model / __init __. Py and model / LOGICAL_UNITS.py .

Only

Step 1 - Overview

Use graph printing capabilities.

This should give you a good overview so that anybody can help you find "communities". Groups of models that have strong cross dependencies usually have a very good app in those communities.

Step 2 - Naming:

If you can find a name for a new application, then this is probably not the same.


No comments:

Post a Comment