开发者

Django: Where to put global models?

开发者 https://www.devze.com 2023-02-04 09:54 出处:网络
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 tot

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

精彩评论

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