Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
127 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Compatibility layer for various django and python versions imports | ||
""" | ||
|
||
try: | ||
from django.urls import reverse | ||
except ImportError: # For Django version less than 2.0 | ||
from django.core.urlresolvers import reverse # noqa | ||
|
||
try: | ||
# Python 2.7 | ||
from urllib import quote_plus | ||
except ImportError: | ||
# Python 3+ | ||
from urllib.parse import quote_plus # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
try: | ||
from django.conf.urls import patterns, include, url | ||
except ImportError: # django < 1.4 | ||
from django.conf.urls.defaults import patterns, include, url | ||
import django | ||
from django.conf.urls import include, url | ||
|
||
# Uncomment the next two lines to enable the admin: | ||
from django.contrib import admin | ||
admin.autodiscover() | ||
|
||
urlpatterns = patterns('', | ||
url(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')), | ||
url(r'^secret/', include(admin.site.urls)), | ||
) | ||
if django.VERSION < (2, 0): | ||
urlpatterns = [ | ||
url(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')), | ||
url(r'^secret/', include(admin.site.urls)), | ||
] | ||
else: | ||
from django.urls import path | ||
urlpatterns = [ | ||
path('admin/', include('admin_honeypot.urls', namespace='admin_honeypot')), | ||
path('secret/', admin.site.urls), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters