Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.py startapp as sparingly as possible.

like image 467
Naftuli Kay Avatar asked Feb 25 '23 10:02

Naftuli Kay


1 Answers

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
like image 200
Deniz Dogan Avatar answered Mar 07 '23 16:03

Deniz Dogan