Closed tampakrap closed 12 years ago
This could be a bug (or feature) in django itself, but the proper solution is to get rid of the cronjobs and move to celery
I'd go with Celery being more "Django-ish" in choice rather than dirty hacking stuff around with cronjobs to circumvent said problem.
However Celery requires a broker of its own for communication which increases the set of deps by 2 (Celery + your broker of choice)
if deps are not a problem though then yeah think of a move to that.
NOTE: if you are handling critical data.. you better avoid redis here , even if its feature complete it tends to barf with power failures
the migration to celery is still needed though, the wiki entry will stay there
For unknown reason, the logger is NOT able to find a handler unless a settings.VARIABLE is called! In some cronjobs, this was done through imports of other modules that reside inside django/, most commonly the import of django.db which contains (in the
__init__.py
file) the variable settings.DATABASES. In cronos, in order to work around it, I added settings.DEBUG inapps/__init__.py
Steps to reproduce: 1) Comment out settings.DEBUG fromapps/__init__.py
2) Put the following script underapps/teilar/handlerbug.py
:3) Run the script: python apps/teilar/handlerbug.py