Skip to content

Commit

Permalink
Merge pull request #67 from harisibrahimkv/G-66
Browse files Browse the repository at this point in the history
Implements support for Django 3.0
  • Loading branch information
dmpayton committed Apr 30, 2020
2 parents cc5d4d9 + 86f724f commit a0d1cd4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -9,6 +9,8 @@ matrix:
python: '3.6'
- env: TOXENV=django20-py36
python: '3.6'
- env: TOXENV=django30-py36
python: '3.6'

- env: TOXENV=coverage
python: '3.6'
Expand Down
9 changes: 4 additions & 5 deletions README.rst
Expand Up @@ -40,13 +40,12 @@ tl;dr

::

urlpatterns = patterns(''
urlpatterns = [
...
url(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
url(r'^secret/', admin.site.urls),
)
path('admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
path('secret/', admin.site.urls),
]

* Run ``python manage.py migrate``

NOTE: replace ``secret`` in the url above with your own secret url prefix

9 changes: 4 additions & 5 deletions docs/manual/usage.rst
Expand Up @@ -15,12 +15,11 @@ Basic setup

2. Update urls.py::

urlpatterns = patterns(''
urlpatterns = [
...
url(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
url(r'^secret/', admin.site.urls),
...
)
path('admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),
path('secret/', admin.site.urls),
]

3. Run migration::

Expand Down
2 changes: 1 addition & 1 deletion tests/settings.py
Expand Up @@ -5,7 +5,7 @@
DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = MANAGERS = (('Admin User', 'admin@example.com'))
ADMINS = MANAGERS = [('Admin User', 'admin@example.com')]

DATABASES = {
'default': {
Expand Down
6 changes: 3 additions & 3 deletions tests/test_suite.py
Expand Up @@ -54,9 +54,9 @@ def test_same_content(self):
)

# Drop CSRF token
csrf_re = re.compile(r"(<input [^/>]+ value=')[a-zA-Z0-9]+'")
admin_html = csrf_re.sub(r"\1'", admin_html)
honeypot_html = csrf_re.sub(r"\1'", honeypot_html)
csrf_re = re.compile(r"(<input [^/>]+ value=['\"])[a-zA-Z0-9]+")
admin_html = csrf_re.sub(r"\1[']", admin_html)
honeypot_html = csrf_re.sub(r"\1[']", honeypot_html)

self.assertEqual(honeypot_html, admin_html)

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Expand Up @@ -7,6 +7,7 @@
envlist =
django111-py{27,36}
django20-py36
django30-py36

[testenvbase]
deps =
Expand All @@ -19,6 +20,7 @@ commands = py.test tests/
deps =
django111: Django>=1.11,<2
django20: Django>=2,<2.1
django30: Django>=3,<4
{[testenvbase]deps}

[testenv:coverage]
Expand All @@ -28,7 +30,7 @@ commands =
py.test tests/ --cov admin_honeypot --cov-config .coveragerc --cov-report term-missing --pep8 admin_honeypot
coveralls
deps =
Django>=2,<2.1
Django>=3,<4
coveralls
pytest-cov
pytest-pep8
Expand Down

0 comments on commit a0d1cd4

Please sign in to comment.