Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andy McKay
committed
Jan 31, 2011
1 parent
c580dfd
commit 00e0404
Showing
3 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
django-cronjobs | ||
django-include-cache | ||
------------------ | ||
|
||
This provide a @cron decorator to mark cronjob methods and | ||
a namespace for managei. | ||
If you've got a large number of includes in your Django urls.py, then there | ||
can be a performance hit in accessing urls at the bottom of the includes as | ||
Django searches through multiple url patterns to find the match. | ||
|
||
Installation | ||
================= | ||
This monkey patches URLResolvers so that when the right pattern is found we | ||
cache that pattern and move it to the top of the url pattern stack so it will | ||
be found quicker. | ||
|
||
In completely unscientific tests on one site, before: | ||
|
||
:: | ||
pip install cronjobs | ||
Requests per second: 438.49 [#/sec] (mean) | ||
|
||
Add 'cronjobs' to your INSTALLED_APPS. | ||
After: | ||
|
||
Usage | ||
Requests per second: 585.39 [#/sec] (mean) | ||
|
||
Installation | ||
================= | ||
|
||
Methods can be added to anywhere, but if you put them in a file called cron.py, | ||
they will be automatically imported. | ||
1. Install from pypi:: | ||
|
||
Register you method by decorating it with @register for example:: | ||
from cronjobs import register | ||
@register | ||
def some_function(): | ||
pass | ||
pip install django-include-cache | ||
|
||
You can then run:: | ||
manage.py cron some_function | ||
2. In manage.py (or your wsgi script) add:: | ||
|
||
import include_cache | ||
include_cache.patch() | ||
|
||
License: Mozilla Public License | ||
Authors: originally by Jeff Balogh, packaged and broken by Andy McKay | ||
Author: Andy McKay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters