{ "info": { "author": "Unhaggle Inc.", "author_email": "", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "License :: OSI Approved :: BSD License", "Operating System :: POSIX", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Utilities" ], "description": "# django-cronman\n\n## Overview\n\nDjango app to define and manage periodic tasks at Python level.\n\n## Installation\n\n`django-cronman` can be installed directly from PyPI using `pip`:\n\n```bash\npip install django-cronman\n```\n\nYou can also install it with additional dependencies to be able to use Cron Remote Manager.\n\n```bash\npip install django-cronman[redis]\n```\n\n## Define a new cron job\n\nCron job definition is inspired by Django Admin configuration. To add a new job, you have to create `cron_job.py`\nfile inside an app, create `BaseCronJob` subclass inside and register it:\n\n```python\nfrom cronman.job import BaseCronJob, cron_job_registry\n\nclass HelloWorld(BaseCronJob):\n \"\"\"Demo Cron Job class\"\"\"\n\n def run(self):\n \"\"\"Main logic\"\"\"\n pass\n\ncron_job_registry.register(HelloWorld)\n```\n\nCron job classes are registered (and referred to) by name, which may be customized on registration:\n```python\ncron_job_registry.register(HelloWorld, name='Hello')\n```\nIt's also possible to retrieve or unregister a class (e.g. while testing):\n```python\ncron_job_registry.get('HelloWorld')\ncron_job_registry.unregister('HelloWorld')\n```\nIf there is more than 1 cron job in given app, it's recommended to create a package instead of single `cron_jobs` module, create one submodule per class and do the imports and registration in package's `__init__.py`.\n\n## Configure cron jobs\n\nTo ensure that a cron job is executed periodically, you have add an entry to `CRON_JOBS`:\n\n```python\nCRON_JOBS = (\n ...\n # (