django custom command not found

I had the same problem. The reason was that the project root was not in my $PYTHONPATH. The solution in this case is to type (on a Linux machine) something like

PYTHONPATH=./project python manage.py myapp_task

The directory structure in your answer is a little ambiguous; when placing the files as follows django should be able to find your command:

project/ # in your question this would be 'application'
    manage.py
    blog/
        __init__.py
        models.py
        management/
            __init__.py
            commands/
                __init__.py
                myapp_task.py
        views.py

Furthermore, you'll need to enable your app in your settings.py:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.admin',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'blog', # <= your app here ...
)

My problem was I was adding the management directory in my main app besides my settings.py file once I have added it to another app it worked

Tags:

Django