I've written a simple custom command, hello.py:
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "prints hello world"
def handle_noargs(self, **options):
print "Hello, World!"
When I run python manage.py hello it returns
Unknown command: 'hello'
- I've put it in the management/commands directory beneath my app.
- I've added __init__.py files to the management and commands directory.
- I've checked my app is in INSTALLED_APPS in settings.py
- I've tried installing it in different apps and from the project root too
Running python manage.py syncdb etc is fine. And if I type python at the command line I can import django.core.management ok.
I know I'm missing something obvious, but can't figure out what.
How can I debug this to work out why my custom command won't run?