Following is a custom command I have written in following file myapp/management/commands/create_myadmin.py
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
class Command(BaseCommand):
help = 'Creates a superuser that can view the admin page'
def handle(self, *args, **options):
try:
user = User.objects.get(username='myadmin')
except User.DoesNotExist:
user = User.objects.create_superuser('myadmin', 'myadmin@mymail.com', 'myadmin')
user.save()
After this, I added myapp into INSTALLED_APPS in myproject/settings.py
My problem is that when I use autocomplete feature and list down commands starting with "create", it doesn't show help string against create_myadmin as shown below
python3 manage.py create (pressed tab here)
createcachetable -- creates table for SQL cache backend
createsuperuser -- create a superuser
create_admin_user (help string missing??)
I expected the string stored in help variable to be visible here. Any quick pointers?
Update: I checked code for django/core/management/commands/createcachetable.py and the help text mentioned there doesn't match what I got above. Any idea where can one define the help text shown in above autocomplete?