08-02-2023, 04:21 PM
Having issues getting django custom commands to work.
From django <a href="http://docs.djangoproject.com/en/dev/howto/custom-management-commands/">documetation</a>, have placed
application/
manage.py
blog/
__init__.py
models.py
management/
__init__.py
commands/
__init__.py
myapp_task.py
views.py
myapp_task.py content is
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print 'Doing task...'
# invoke the functions you need to run on your project here
print 'Done'
when ran
python manage.py myapp_task
getting error
Unknown command: 'myapp_task'
From django <a href="http://docs.djangoproject.com/en/dev/howto/custom-management-commands/">documetation</a>, have placed
application/
manage.py
blog/
__init__.py
models.py
management/
__init__.py
commands/
__init__.py
myapp_task.py
views.py
myapp_task.py content is
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print 'Doing task...'
# invoke the functions you need to run on your project here
print 'Done'
when ran
python manage.py myapp_task
getting error
Unknown command: 'myapp_task'