0

I want to use cronjobs to write data in my database. I use crontab do manage that.

I hav setup the setting.py file like this: CRONJOBS = [ ('*/2 * * * *', 'someapp.cron.my_cron_test', ) ]

the actual cron.py is in the app folder and looks like this:

from django.conf import settings
from someapp.models import Some_model

def my_cron_test():
    name = "Test"
    lang = Some_model.objects.create(name=name)

I get a error message from crontab: django.db.utils.OperationalError: no such table: someapp_some_model Using registration/login_social.html as the login template

I am running Django4 locally.

The code was supposed to add an instance to a django model.

I work with a virtual env

0 Answers0