开发者

Django: Where to put global models?

I'm building a fairly large website in Django, and it's my first time doing anything of this scale with the framework. (I have, however, used it in the past, so I know my way around and am not a total newbie.) I have a number of model classes which will be used throughout the application, so my question is where would be the best place to put them?

I could also use some tips as to how to structure my project. I don't want to have some crazy hierarchy, and I'd like to use ./manage开发者_JS百科.py startapp as sparingly as possible.


I think the easiest way is to make a "main" application and then import the models from that application into your other peripheral apps when you need the main models.

manage.py startapp main
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜