urls.py 689 B

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