0

I've covered some related topic here on stackoverflow and on some another websites, but still I can't decide, how should I organize Django apps? Before, I used CodeIgniter and I liked it organization structure. Ok. The basic structure looks like

testsite/
├── manage.py
│
├── testsite/
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
│
└── testapp/
    ├── __init__.py
    ├── models.py
    ├── tests.py
    └── views.py

For example, I need model for users and a blog. Do I need write both of it in -testapp/models.py, or it would be better to create different app for blog / users?

4

1 回答 1

2

你可以把它放在你认为最有意义的地方。如果您只拥有一个 Blog 模型并且没有与之相关的功能,将它放在您的testapp.应该是它自己的应用程序blog

模型也是如此user

还要确保你检查了 djangos 内置User模型

于 2013-08-16T16:29:02.317 回答