ImportError: No module named django_crontab
Question: I am trying to set up some cron jobs in Linux using django-crontab 0.6 (which
is installed). I have added 'django_crontab' to INSTALLED_APPS in settings,
and I have specified the jobs using:

    
    
    CRONJOBS = [
        ('0 0 * * *', 'proj.app.cron.update_entries'),
        ('0 * * * *', 'proj.app.cron.delete_queries')
    ]
    

When I try to add the jobs using the command:

    
    
    python3 manage.py crontab add
    

...I get an error. Here is the traceback:

    
    
    Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/usr/local/lib/python3.2/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
        utility.execute()
      File "/usr/local/lib/python3.2/dist-packages/django/core/management/__init__.py", line 312, in execute
        django.setup()
      File "/usr/local/lib/python3.2/dist-packages/django/__init__.py", line 18, in setup
        apps.populate(settings.INSTALLED_APPS)
      File "/usr/local/lib/python3.2/dist-packages/django/apps/registry.py", line 85, in populate
        app_config = AppConfig.create(entry)
      File "/usr/local/lib/python3.2/dist-packages/django/apps/config.py", line 86, in create
        module = import_module(entry)
      File "/usr/lib/python3.2/importlib/__init__.py", line 124, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "/usr/lib/python3.2/importlib/_bootstrap.py", line 824, in _gcd_import
        raise ImportError(_ERR_MSG.format(name))
    ImportError: No module named django_crontab
    

I am using Django 1.8.4.


Answer: Looks like there awas a bug about it: <https://github.com/kraiz/django-
crontab/issues/20>

> "the correct module_path is myapp.cron not myproj.myapp.cron"

Could you please try the following code:

    
    
    CRONJOBS = [
        ('0 0 * * *', 'app.cron.update_entries'),
        ('0 * * * *', 'app.cron.delete_queries')
    ]
    

?

