django-crontab

Dead simple crontab powered job scheduling for Django
Download

django-crontab Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Publisher Name:
  • Lars Kreisz
  • Publisher web site:
  • https://github.com/kraiz/

django-crontab Tags


django-crontab Description

Dead simple crontab powered job scheduling for Django django-crontab is a Django app that provides a dead simple crontab powered job scheduling for Django.setupinstall via easy_install or pip easy_install django-crontabadd it to installed apps in django settings.py INSTALLED_APPS = ( 'django_crontab', ... )now create a new method that should be executed by cron every 5 minutes, f.e. in myproject/myapp/cron.py def my_scheduled_job(): passnow add this to your settings.py: CRONJOBS = the least to do is to run this command to add all defined jobs from CRONJOBS to crontab (of the user which you are running this command with): python manage.py crontab addremoving all defined jobs is straight forward python manage.py crontab removeconfigthere are a bunch of setting vars to customize behavior. each of this comes with default values that should properly fit. if not, feel free to overwrite. CRONJOBS list of tuples with cron timing and the python module path to the method default: [] example CRONJOBS = CRONTAB_EXECUTABLE path to the crontab executable of your os default: '/usr/bin/crontab' CRONTAB_DJANGO_PROJECT_NAME the name of your django project, used to build path path to manage.py default is read from DJANGO_SETTINGS_MODULE environment variable CRONTAB_DJANGO_MANAGE_PATH path to manage.py file default is build using DJANGO_PROJECT_NAME CRONTAB_PYTHON_EXECUTABLE path to the python interpreter executable used to run the scheduled job default uses the interpreter executable used to add the jobs CRONTAB_COMMAND_PREFIX something you wanne do before job gets executed. default: '' (empty string) example: 'echo "executing my scheduled job now" &&' CRONTAB_COMMAND_SUFFIX something you wanne do after job was executed. default: '' (empty string) example: '&& echo "execution of my scheduled job finished"' Requirements: · Python · Django


django-crontab Related Software