updating djangocms database entry via script not working with cronjob
Question: I have a python script which automatically updates a database entry of the
`djangocms_text_ckeditor_text` table. I'm using djangocms 3 on debian wheezy.
When running this script from the bash with `trutty:~$ ./update.py` it works
and the database entry gets updated. However, when running the same script
with a cronjob (specified in `crontab -e -u trutty`), the entry does not get
updated although the script runs.

My script looks like this:

    
    
    #!/home/trutty/v/bin/python
    ...
    from django import settings
    from djangocms_text_ckeditor.models import Text
    from cms.models.pluginmodel import CMSPlugin
    ...
    c = CMSPlugin.objects.filter(placeholder_id=8, parent_id__isnull=True)
    if c:
        t = Text.objects.get(pk=c.first().id)
        t.body = ...
        t.save()
        ...
    

What am I missing?


Answer: I now get the page object and save it right after `t.save()`.

    
    
    from cms.models.pagemodel import Page
    ...
    p = Page.objects,get(...)
    ...
    t.save()
    p.save()
    

