On 12/18/2020 8:48 PM, Diptesh Choudhuri wrote:
As of now, if you need to create a management command, it is necessary to create a file *app_name/management/commands/my_command.py, *and then add *app_name *to *INSTALLED_APPS *in *settings.py. *This prevents non-django packages from defining their own management commands, because it explicitly requires them to create a django app which just adds a bunch of unnecessary files to their source code.

I propose we overhaul the existing management command discovery system so that it is easier to write management commands. Also I suggest we keep the default discoverer in place so as to maintain backwards compatibility.

All of this will require documentation and I am ready to make a PR for that too. Please tell me if the idea is feasible, and I will get to work on it ASAP.

Best
Diptesh Choudhuri

What extra files do you think are necessary? I just created a project consisting of the management/commands directory and a command file. I then installed the package in a venv, imported the module in my settings.py file and added it to INSTALLED_APPS. Works fine. No other files or directories were needed. (Python 3.8, Django 3.1)


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/2e35af7d-131a-4c14-8777-bee08f65120b%40comcast.net.

Reply via email to