Skip to content

Commit 01b1048

Browse files
committed
Add Django 2.0 support
1 parent e90e6fd commit 01b1048

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

static_sitemaps/generator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
from django.core.files.base import ContentFile
1616
from django.core.files.storage import FileSystemStorage
1717
from django.core.paginator import EmptyPage, PageNotAnInteger
18-
from django.core.urlresolvers import reverse, NoReverseMatch
18+
try:
19+
from django.core.urlresolvers import reverse, NoReverseMatch
20+
except ImportError: # Django >= 2.0
21+
from django.urls import reverse, NoReverseMatch
1922
from django.template import loader
2023
from django.utils import translation
2124
from django.utils.encoding import smart_str

0 commit comments

Comments
 (0)