Django: Can't run custom commands

后端 未结 2 1722
温柔的废话
温柔的废话 2021-02-20 13:48

I\'ve written a simple custom command, hello.py:

from django.core.management.base import NoArgsCommand

class Command(NoArgsCommand):
    help = \"prints hello w         


        
2条回答
  •  [愿得一人]
    2021-02-20 14:17

    It is because the __init__.pyc does not get created automatically within "management" and "commands" folder. Copy your_app/__init__.py and your_app/__init__.pyc and paste it within the management/ and commands/ folder.

提交回复
热议问题