Skip to content

Commit 6c58072

Browse files
authored
Upgrade for Django 4+
Works with 3 and 4.
1 parent 0275dff commit 6c58072

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

trix/urls.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
from django.conf.urls import include, url
2-
from .views import UploadTrixAttachment
1+
try:
2+
# Django 3.x
3+
from django.conf.urls import url
4+
except ImportError:
5+
# Django 4.x+
6+
from django.urls import re_path as url
37

8+
from django.urls import include
9+
from .views import UploadTrixAttachment
410

511
urlpatterns = [
612
url(r'^attachment/$', UploadTrixAttachment.as_view()),

0 commit comments

Comments
 (0)