Skip to main content

Home/ Django/ Group items tagged cron

Rss Feed Group items tagged

pagetribe .

Integrate Web APIs into Your Django Site - Webmonkey - 0 views

  • Link.objects.get_or_create( url = info['href'], description = info['extended'], tags = info.get('tag', ''), date = parsedate(info['time']), title = info['description']
  • But we don't want to have to log in to the shell every time we want to update our displayed list of bookmarks. In fact, we want our site to automatically update itself. To do that, we're going to write a quick python script and then run it through a cron job.
  • problem
  • ...9 more annotations...
  • sync_link.py
  • Now worries though -- we just need to tell it about it.
  • create a new folder
  • name it "links."
  • class Link
  • "utils.py"
  • create a new file
  • links directory
  • utils.py
  •  
    Gives a good example of how to update a database via cron.
pagetribe .

Standalone Django scripts - 0 views

  • Set DJANGO_SETTINGS_MODULE before you run
  • export DJANGO_SETTINGS_MODULE=yoursite.settings
  • # Cron jobs for foo.com run at 3AM DJANGO_SETTINGS_MODULE=foo.settings 0 3 * * * python /path/to/maintenance/script.py 30 3 * * * python /path/to/other/script.py # Cron jobs for bar.com run at 4AM DJANGO_SETTINGS_MODULE=bar.settings 0 4 * * * python /path/to/maintenance/script.py 30 4 * * * python /path/to/other/script.py
pagetribe .

Django and Crontab: Best Friends - 0 views

  •  
    setup_environ
1 - 4 of 4
Showing 20 items per page