Skip to content

Commit

Permalink
Merge pull request #101 from Whitie/django4
Browse files Browse the repository at this point in the history
Changed url to re_path for compatibility with Django >= 4.
  • Loading branch information
czue authored Jan 18, 2023
2 parents 11e1870 + d080efb commit 2361f3a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions celery_progress/websockets/routing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from django.conf.urls import url
try:
from django.conf.urls import url
re_path = url
except ImportError:
from django.urls import re_path

from celery_progress.websockets import consumers

Expand All @@ -8,5 +12,5 @@
progress_consumer = consumers.ProgressConsumer # Channels 3 not installed, revert to Channels 2 behavior

urlpatterns = [
url(r'^ws/progress/(?P<task_id>[\w-]+)/?$', progress_consumer),
re_path(r'^ws/progress/(?P<task_id>[\w-]+)/?$', progress_consumer),
]

0 comments on commit 2361f3a

Please sign in to comment.