Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: drop unsupported django versions <3.2 #154

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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