From 78043ef8a8d6bfb4b8e737f61b235de742d4ffa0 Mon Sep 17 00:00:00 2001 From: Nils Rokita Date: Fri, 6 May 2022 23:54:40 +0200 Subject: [PATCH] Compatibility for Django > 3.2 --- .gitignore | 3 +++ README.rst | 13 +++++++++++-- .../__init__.py | 0 .../middleware/__init__.py | 0 .../middleware/csp.py | 0 .../templatetags/__init__.py | 0 .../templatetags/csp.py | 0 setup.py | 6 +++--- 8 files changed, 17 insertions(+), 5 deletions(-) rename {django-simple-csp => django_simple_csp}/__init__.py (100%) rename {django-simple-csp => django_simple_csp}/middleware/__init__.py (100%) rename {django-simple-csp => django_simple_csp}/middleware/csp.py (100%) rename {django-simple-csp => django_simple_csp}/templatetags/__init__.py (100%) rename {django-simple-csp => django_simple_csp}/templatetags/csp.py (100%) diff --git a/.gitignore b/.gitignore index 7f7cccc..4e0329f 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,6 @@ docs/_build/ # PyBuilder target/ +# Pycharm +.idea +.pyenv diff --git a/README.rst b/README.rst index 0469857..a1b9eed 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,7 @@ Add it to the INSTALLED_APPS settings variable:: 'django.contrib.messages', 'django.contrib.staticfiles', ... - 'django-simple-csp' + 'django_simple_csp' ... ] @@ -78,7 +78,7 @@ Config Values ------------- CSP_REPORT_URL = "" -The URl CSP errors should be reportet to, set to "" if not used, or do not define it. +The URl CSP errors should be reported to, set to "" if not used, or do not define it. CSP_REPORT_ONLY = True Set the header to just report CSP errors do not enforce the CSP. Defaults to True. @@ -91,3 +91,12 @@ List of additional hosts CSS is allowed to be loaded from CSP_ADDITIONAL_IMG_SRC = [] List of additional hosts images is allowed to be loaded from + + +Upgrades +----------- + +From < 0.3 +~~~~~~~~~~ + +'django-simple-csp' has to be changed into 'django_simple_csp' in th INSTALLED_APPS in Django settings.py diff --git a/django-simple-csp/__init__.py b/django_simple_csp/__init__.py similarity index 100% rename from django-simple-csp/__init__.py rename to django_simple_csp/__init__.py diff --git a/django-simple-csp/middleware/__init__.py b/django_simple_csp/middleware/__init__.py similarity index 100% rename from django-simple-csp/middleware/__init__.py rename to django_simple_csp/middleware/__init__.py diff --git a/django-simple-csp/middleware/csp.py b/django_simple_csp/middleware/csp.py similarity index 100% rename from django-simple-csp/middleware/csp.py rename to django_simple_csp/middleware/csp.py diff --git a/django-simple-csp/templatetags/__init__.py b/django_simple_csp/templatetags/__init__.py similarity index 100% rename from django-simple-csp/templatetags/__init__.py rename to django_simple_csp/templatetags/__init__.py diff --git a/django-simple-csp/templatetags/csp.py b/django_simple_csp/templatetags/csp.py similarity index 100% rename from django-simple-csp/templatetags/csp.py rename to django_simple_csp/templatetags/csp.py diff --git a/setup.py b/setup.py index fb7460e..9aed191 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages -version = '0.2.dev1' +version = '0.3.dev1' def read(*parts): @@ -28,9 +28,9 @@ def read(*parts): description='Django Content Security Policy support.', long_description=read('README.rst'), author='Nils Rokita, Henning Pridöhl', - author_email='0rokita@informatik.uni-hamburg.de; pridoeh@informatik.uni-hamburg.de', + author_email='github@rokita.it; pridoeh@informatik.uni-hamburg.de', maintainer='Nils Rokita', - maintainer_email='0rokita@informatik.uni-hamburg.de', + maintainer_email='github@rokita.it', url='https://github.com/fsinfuhh/django-simple-csp', license='License :: OSI Approved :: MIT License', packages=find_packages(),