Search code examples
djangomodel-view-controllermigrationdjango-south

Could Django project directory more simple structure with or without South?


I'm a new comer to Django.

However, I'm little confused on directory structure of Django. For instance I have to write so many models.py in different place, which, presumably, will cause difficulty to maintain the project in future. I want to make it more like real MVC structure, with every model files in a models directory.

Could it be possible to do that with using South, which seems to only looking at models.py, or should I consider different migration tools?


Solution

  • Django organizes code into 'apps', which is why you have separate models.py files, and I don't think there's a way to put them all in one directory instead, since each app gets its own Python package.

    However, the way I normally structure my code, is to have one (or a few, if it's a larger project) app for all my code, since you can have as many Models in a single models.py file as you want.

    I don't think South will help you with that, but it will make it a lot easier to manage your migrations, so I would highly recommend it.