Django and Celery: admin task list doesn't display values

My problem should be fairly simple and more interesting than something that needs to be desperately fixed. Google could not give me the answer I was looking for, so I hope your experience helps me. I use:

Django 1.4
Celery 2.5.5
Redis 2.4.10 (latest version on homebrew?)

And I start everything using follwing commands:

redis-server /usr/local/etc/redis.conf
foreman run python manage.py runserver
foreman run "python manage.py celeryd -E -B --loglevel=INFO"
foreman run python manage.py celerycam

In my settings.py, I have the following set of settings for Celery:

import djcelery
djcelery.setup_loader()

BROKER_URL = redis
CELERY_RESULT_BACKEND = 'redis'
CELERY_REDIS_HOST = "localhost"
CELERY_REDIS_PORT = 6379
CELERY_REDIS_DB = 0

CELERY_SEND_TASK_ERROR_EMAILS = True
CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
CELERY_TASK_RESULT_EXPIRES = 172800  # 48 hours.

In this configuration, everything works, except for one:

With django-celery, you automatically get celery integration in the django admin (neatly!), You can check the status of all your tasks that have not expired, and also schedule new tasks, etc.

, , None. , , , , . , .

, , ?

:

, , , uuid .., , . ( , ), .

The django-celery admin task list not displaying all values :

The detail page of a task displaying all values

+5
2

. , -. django-celery, , ( ​​ this commit django-celery).

( djcelery.admin_utils fixedwidth):

return """<span title="%s", style="font-size: %spt;\
                font-family: Menlo, Courier; ">%s</span>""" % (
    escape(val[:255]), pt, escape(shortval)).replace("|br/|", "<br/>")

    return ("""<span title="%s", style="font-size: %spt;\
                    font-family: Menlo, Courier; ">%s</span>""" % (
        escape(val[:255]), pt, escape(shortval))).replace("|br/|", "<br/>")

.

+2

. , admin_utils.py, ! :

FIXEDWIDTH_STYLE admin_utils.py:

FIXEDWIDTH_STYLE = '''\
<span title="%s", style="font-size: %spt; \
font-family: Menlo, Courier; ">%s</span> \
'''

:

return """<span title="%s", style="font-size: %spt;\
                font-family: Menlo, Courier; ">%s</span>""" % (
    escape(val[:255]), pt, escape(shortval)).replace("|br/|", "<br/>")

:

styled = FIXEDWIDTH_STYLE % (escape(val[:255]), pt,escape(shortval))
return styled.replace("|br/|", "<br/>")

github. ! !

0

All Articles