What else is supposed to go in the management folder?

Hello there! If this has already been answered, feel free to link me to that, but I couldn’t find an answer in the docs.

When you’re creating a management command, you create a folder structure that looks like

management/
    __init__.py
    commands/
        __init__.py

What is the management folder for, here? If this is a quirk of how manage.py searches for commands, ok, but I’m curious if there’s other things that could go here that could help out a project?

This is one of those questions that makes me think “gee, why haven’t I ever questioned that?”

I can’t speak authoritatively, but I can say that both Django core and Django-extensions put utility classes in that directory. They’re imported by the individual commands.
The django.contrib.auth.management has some functions in __init__.py, along with django.contrib.contenttypes.

So in terms of usage, it could be used for code that is needed by the commands, but aren’t commands themselves.

In my current set of virtual environments, those are the only projects using that directory.

A fairly cursory inspection of the (current) Django source doesn’t show any references to that directory outside the command processor.

From what I can find in the Wayback machine, the oldest reference to that directory is from 2007-11-07, with no indication as to any other purpose for that management directory.

If you go back to 0.96, there was a django.core management.py file - I’ll make the guess that all the commands were stored in that file before that component was refactored to allow for additional commands to be added more easily.

(Also interesting to me is that there’s an SO question asking about this a little more than 10 years ago. )