logoalt Hacker News

3eb7988a1663yesterday at 9:31 PM1 replyview on HN

As things get more complicated, I will separate out by some kind of concept. Which can be something as simple as:

  /coreapp
    /forms_foo.py
    /forms_bar.py
    /models_bar.py
    /models_foo.py
    /views_bar.py
    /views_foo.py
You can do a more sophisticated module layout, but essentially something as straightforward as the above, all under a single "core" application. Prevents Django from fighting you when you want to work across the arbitrary "app" boundary.

Replies

selcukatoday at 5:57 AM

You can also have a /models/ package with foo.py, bar.py under it. It is easier to maintain.

As an additional bonus, you can add an __init__.py that imports all models if you want to be able to do a `from .models import FooModel`.