import os
from datetime import datetime
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.production'
os.environ['DJANGO_CONF'] = 'settings.production'
from util.models import Schedule
dset = Schedule.objects.all()
for rec in dset:
    print(rec)
print('cron executed %s' % datetime.today())
Calling python script from crontab with activate