[Fixed]-Are there any purposes for the management folder in Django other than commands?

4๐Ÿ‘

I donโ€™t know the history, but it seems semi-vestigial to me. As for other stuff that can be put in the management dir, the comment about signals above hints at one answer.

One thing I do when trying to answer such questions is to look at the contrib apps to see what they do. Some interesting bits to be found:

Note that in the second one, the management module is a .py file rather than a directory.

๐Ÿ‘คPaul Bissex

3๐Ÿ‘

Another thing that needs to be placed in the management module (either in management/__init__.py or management.py) is any listeners to the django.db.models.signals.post_sync signal.

๐Ÿ‘คJakub Roztocil

-2๐Ÿ‘

It is a skeleton of djangoโ€™s general design. Almost every project will contain multiple apps, so the project is really a container of apps with a shared configuration.

You can add other items to the project level folder, but the design suggests only high level cross-app items should be. Examples are urls and settings.

๐Ÿ‘คtee

Leave a comment