I'm trying to set up a cronjob on my Ubuntu server to run a django .py file - but I'm having trouble running the script first.
I'm using the command python3 /opt/mydir/manage.py updatefm
which produces the error:
File "/opt/mydir/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 324, in handle
raise NotImplementedError()
NotImplementedError
Can anybody enlighten my on what I'm doing incorrect? Here is my script and structure:
/mydir
/mydir
__init__.py
/management
__init__.py
/commands
updatefm.py
updatefm.py
class Command(BaseCommand):
args = ''
help = 'Help Test'
def update_auto(self, *args, **options):
hi = 'test'
My app name is listed in settings.py as it should be.
__init__.pyinside your/commandsdirectory. Also, I'm not a 100% sure, but I believe you should import said command as well in yourmanage.py__init__.pyin/commandsdirectory if i'm usingpython2docs.djangoproject.com/en/1.7/howto/custom-management-commands/…NotImplementedErrormeans you haven't implemented the full API for a subclass and the parent class can't do it for you. It's being raised by thehandlemethod. You don't implement that. Seems like you should.