user3005684
user3005684

Reputation:

How to organize apps/sub apps in Django

This is more of a conceptual question - I'm new to Django and I'm building a series of apps. Inside of these apps I'd like there to be other apps, or at least a way to organize them so that there arent just apps everywhere in my project. ie. inside my project there will be app 1, 2, 3, 4, 5, etc. and related to app 1 is app a, b, c, d, and e, although app a, b, c, d, and e might also have a relation to apps 2 and 3 in some way, they would still most definitely belong to app 1. Its a very big project and there will probably end up being hundreds of apps when I'm done. Whats the best way to do this? Thank you for any suggestion or advice

Upvotes: 2

Views: 1195

Answers (1)

tmarthal
tmarthal

Reputation: 1528

I'd highly suggest using django-cookiecutter to setup your project: https://cookiecutter-django.readthedocs.io/en/latest/my-favorite-cookie.html

It will create an outer project directory, with a single 'project' in that directory. What you are calling "apps", django calls "projects". You can create more projects using the django-admin startproject <PROJECT_NAME> in the top level directory that the cookiecutter creates.

In each project, you can create django app (what you are calling 'sub-apps') by using the django-admin startapp <APP_NAME> in the project of your choice.

Upvotes: 1

Related Questions