Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
.tox
*.egg-info/*
docs/_build/*
dist/*
dist/
.idea/*
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions favicon/urls.py
Original file line number Diff line number Diff line change
@@ -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')]
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
)