sdelements/django-security

The security/urls.py need updates to work with Django 1.9.0 and above.

cnobile2012 opened this issue · 2 comments

The security/urls.py needs updating.

from django.conf.urls import patterns, url

from security import views


urlpatterns = patterns(
    '',
    url('^/csp-report/$', views.csp_report),
)

Should be:

import django
from django.conf.urls import url

from security import views


if django.VERSION >= (1, 8):
    urlpatterns = [
        url('^/csp-report/$', views.csp_report),
    ]
else:
    from django.conf.urls import patterns
    urlpatterns = patterns(
        '',
        url('^/csp-report/$', views.csp_report),
    )
Gee19 commented

Will make this change and test next week, thanks for reporting this issue.

Gee19 commented

Seems unnecessary, we don't import patterns anymore.