diff --git a/.gitignore b/.gitignore index aef50ce..345efef 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,5 @@ .tox *.egg-info/* docs/_build/* -dist/* +dist/ .idea/* diff --git a/README.rst b/README.rst index 8a20579..e01871c 100644 --- a/README.rst +++ b/README.rst @@ -19,9 +19,12 @@ Add "favicon" to your INSTALLED_APPS in settings.py:: Add favicon URL patterns to urls.py:: + # from django.conf.urls import url, include # Django < 2.0 + from django.urls import path, include urlpatterns = patterns('', ... - url(r'^', include('favicon.urls')), + # url(r'^', include('favicon.urls')), # Django < 2.0 + path ('', include('favicon.urls')) ) Usage diff --git a/favicon/urls.py b/favicon/urls.py index c3fb632..2eda9a5 100644 --- a/favicon/urls.py +++ b/favicon/urls.py @@ -1,7 +1,8 @@ -from django.conf.urls import url +try: + from django.conf.urls import url +except ImportError: + from django.urls import re_path as url from django.views.generic import TemplateView, RedirectView from . import conf -urlpatterns = [ - url(r'^favicon\.ico$', RedirectView.as_view(url=conf.FAVICON_PATH, permanent=True), name='favicon'), -] +urlpatterns = [url(r'^favicon\.ico$', RedirectView.as_view(url=conf.FAVICON_PATH, permanent=True), name='favicon')] diff --git a/setup.py b/setup.py index ae330ea..fd2e9de 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ def read_file(filename): - """Read a file into a string""" + '''Read a file into a string''' path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: @@ -25,14 +25,22 @@ def read_file(filename): classifiers=[ 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Intended Audience :: Developers', - 'Programming Language :: Python', + 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Framework :: Django', + 'Framework :: Django :: 1.11', + 'Framework :: Django :: 2.0', + 'Framework :: Django :: 2.1', + 'Framework :: Django :: 2.2', 'Development Status :: 4 - Beta', 'Operating System :: OS Independent', ], long_description=read_file('README.rst'), - test_suite="runtests.runtests", + test_suite='runtests.runtests', zip_safe=False, )