hoping I can get some guidance on django crontab.
I have the following set up: in settings.py:
INSTALLED_APPS = [
'django_crontab',
........
]
#other settings not related to crontab
CRONJOBS = [
('*/1 * * * * ', 'my_app.cron.cronjob')
]
in my my_app/cron.py(for now I have a model with the name 'name'):
def cronjob():
total_ref = models.Count.objects.get(name='name')
total_ref.total += 1
total_ref.save()
return()
in my my_app/models.py:
class Count(models.Model):
name = models.CharField(max_length=100, blank=True, null=True)
total = models.IntegerField(blank=True, null=True)
def __str__(self):
return self.name
When i run the following:
$ python manage.py crontab add
crontab: no crontab for user
adding cronjob: (26ea74b6ee863259e86bcab90f96ec1a) -> ('*/1 * * * * ', 'ms_app.cron.switch_count')
And when i check to see if it is in my crontab
$ crontab -l
*/1 * * * * /Path_to_env/bin/python /Path_to_my_app/my_project/manage.py crontab run 26ea74b6ee863259e86bcab90f96ec1a # django-cronjobs for myl_project
i am running python 3.8.2 with Django 3.2.5 and django_crontab 0.7.1
With all of this checked I still do not get any changes when I go and check my model entry (total)