Skip to content

Commit

Permalink
feat: drop unsupported django versions <3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMalte authored and jpic committed Apr 12, 2024
1 parent 071ae17 commit fe33707
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Requirements

- Python 2.7 or 3.5+
- jQuery 1.7+
- Django 1.8 to 4.0
- Django 3.2 to 4.0
- django.contrib.staticfiles or #YoYo

Resources
Expand Down
56 changes: 45 additions & 11 deletions docs/source/quick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,66 @@ because your time matters and you probably have other things to worry about.
Install the package::

pip install django-session-security
# or the development version
pip install -e git+git://github.com/yourlabs/django-session-security.git#egg=django-session-security

For static file service, add to ``settings.INSTALLED_APPS``::
For static file service, add ``session_security`` to your ``INSTALLED_APPS`` settings:

'session_security',
.. code-block:: python
Add to ``settings.MIDDLEWARE_CLASSES``, **after** django's AuthenticationMiddleware::
INSTALLED_APPS = [
# ...
'session_security',
# ...
]
'session_security.middleware.SessionSecurityMiddleware',
Add ``session_security.middleware.SessionSecurityMiddleware`` to your ``MIDDLEWARE`` settings:

Ensure settings.TEMPLATE_CONTEXT_PROCESSORS has::
.. code-block:: python
'django.core.context_processors.request'
MIDDLEWARE = [
# ...
'session_security.middleware.SessionSecurityMiddleware',
# ...
]
Add to urls::
.. warning::

url(r'session_security/', include('session_security.urls')),
The order of ``MIDDLEWARE`` is important. You should include the ``django-session-security`` middleware
after the authentication middleware, such as :class:`~django.contrib.auth.middleware.AuthenticationMiddleware`.

Ensure ``django.template.context_processors.request`` is added to the template context processors:

.. code-block:: python
TEMPLATES = [
{
"OPTIONS": {
"context_processors": [
"django.template.context_processors.request",
# ...
]
}
# ...
}
]
Add ``session_security`` URLs to your project’s URLconf:

.. code-block:: python
from django.urls import include, path
urlpatterns = [
# ...
path('session_security/', include('session_security.urls')),
]
At this point, we're going to assume that you have `django.contrib.staticfiles
<https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/>`_ working.
This means that `static files are automatically served with runserver
<https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#runserver>`_,
and that you have to run `collectstatic when using another server
<https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#collectstatic>`_
(fastcgi, uwsgi, and whatnot). If you don't use django.contrib.staticfiles,
(fastcgi, uwsgi, and whatnot). If you don't use `django.contrib.staticfiles`,
then you're on your own to manage staticfiles.

After jQuery, add to your base template::
Expand Down
12 changes: 1 addition & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[tox]
envlist =
py{27,35,36}-django{18,19,110,111}
py{35,36,37,38}-django{111,22}
py{36,37,38,39,310}-django{30,31,32}
py{38,39,310}-django{40,41}
py{38,39,310}-django{32,40,41}
[testenv]
usedevelop = true
commands =
Expand All @@ -12,13 +9,6 @@ deps =
coverage
unittest-data-provider
selenium<4.3.0
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11,<1.12
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
Expand Down

0 comments on commit fe33707

Please sign in to comment.