django custom command not found -
Demo custom command is having trouble working.
From the Django,
Applications / manage.pyBlog / __init__.py Model .py management / __init__.py command / __init__.py myapp_task.py
myapp_task.py is the content
from django.core.management.base import noArgsCommand class command (NoArgsCommand): DEF handle_onears (auto, ** option): print ' Working ... '# print the call you need to run on your project' '
while running
Python Manage.py myapp_task
is getting the directory in your answer The composition is a little vague; Django should be able to find its order when entering files:
project / # In your question, this 'application' manage.py blog / __init__.py models.py management / __init__.py Commands / __init__.py myapp_task.py
In addition, you must 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 ', # & Lt; = your app here ...)
Comments
Post a Comment