urls.py 747 B

1234567891011121314151617181920212223
  1. from __future__ import absolute_import, unicode_literals
  2. from django.conf.urls.defaults import ( # noqa
  3. url, patterns, include, handler404, handler500,
  4. )
  5. from djcelery import views as celery_views
  6. from celery_http_gateway.tasks import hello_world
  7. # Uncomment the next two lines to enable the admin:
  8. # from django.contrib import admin
  9. # admin.autodiscover()
  10. urlpatterns = patterns(
  11. '',
  12. url(r'^apply/(?P<task_name>.+?)/', celery_views.apply),
  13. url(r'^hello/', celery_views.task_view(hello_world)),
  14. url(r'^(?P<task_id>[\w\d\-]+)/done/?$', celery_views.is_task_successful,
  15. name='celery-is_task_successful'),
  16. url(r'^(?P<task_id>[\w\d\-]+)/status/?$', celery_views.task_status,
  17. name='celery-task_status'),
  18. )