Skip to content

Commit 5c1f620

Browse files
authored
feat: drop django 3.2, 4.0 and 4.1 support
1 parent 984518b commit 5c1f620

File tree

9 files changed

+58
-49
lines changed

9 files changed

+58
-49
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
build-and-publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212

1313
- name: Set up Python 3.9
14-
uses: actions/setup-python@v1
14+
uses: actions/setup-python@v5
1515
with:
1616
python-version: 3.9
1717

.github/workflows/test.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ jobs:
1010
name: Run Tests (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
1111
runs-on: ubuntu-latest
1212
strategy:
13-
fail-fast: false
13+
fail-fast: true
1414
max-parallel: 5
1515
matrix:
1616
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17-
django-version: ['3.2', '4.0', '4.1', '4.2', '5.0']
17+
django-version: ['4.2', '5.0', '5.1']
1818
exclude:
1919
# exclude django 5.0 not supported python versions
2020
- python-version: '3.8'
2121
django-version: '5.0'
2222
- python-version: '3.9'
2323
django-version: '5.0'
24-
# exclude django 3.2 not supported python versions
25-
- python-version: '3.12'
26-
django-version: '3.2'
24+
- python-version: '3.8'
25+
django-version: '5.1'
26+
- python-version: '3.9'
27+
django-version: '5.1'
2728

2829
services:
2930
postgres:
@@ -40,10 +41,10 @@ jobs:
4041

4142
steps:
4243
- name: Clone Repository
43-
uses: actions/checkout@v3
44+
uses: actions/checkout@v4
4445

4546
- name: Set up Python ${{ matrix.python-version }}
46-
uses: actions/setup-python@v2
47+
uses: actions/setup-python@v5
4748
with:
4849
python-version: ${{ matrix.python-version }}
4950

@@ -53,7 +54,7 @@ jobs:
5354
pip install .[test]
5455
pip install psycopg2
5556
pip install django==${{ matrix.django-version }}
56-
57+
5758
- name: Ensure browsers are installed
5859
run: python -m playwright install --with-deps
5960

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<p align="center">
88
<img alt="Supported Python Versions" src="https://img.shields.io/badge/Python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue" />
9-
<img alt="Supported Django Versions" src="https://img.shields.io/badge/Django-3.2%20|%204.0%20|%204.1%20|%204.2%20|%205.0-blue" />
9+
<img alt="Supported Django Versions" src="https://img.shields.io/badge/Django-4.2%20|%205.0%20|%205.1-blue" />
1010
<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/django-image-uploader-widget" />
1111
<img alt="GitHub License" src="https://img.shields.io/github/license/inventare/django-image-uploader-widget" />
1212
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/django-image-uploader-widget" />
@@ -20,7 +20,8 @@
2020
## Requirements
2121

2222
- Python 3.8+
23-
- Django 3.2+
23+
- Django 4.2+
24+
- Django 3.2,4.0,4.1 (uses `django-image-uploader-widget<=0.7.1`)
2425

2526
## Features
2627

@@ -33,17 +34,6 @@
3334
- [x] Support upload by dropping file.
3435
- [x] Out of box HTMX support.
3536

36-
## Future Roadmap
37-
38-
| Intented Version | Description | Expected date |
39-
| ----------------- | ---------------------------------------------------------- | ------------- |
40-
| 0.6.0 | Support for Drag and Drop for reordering on mobile phones. [#153](https://github.com/inventare/django-image-uploader-widget/issues/153) | August, 2024 |
41-
| 0.7.0 | Add support for the htmx swap initialization. [#177](https://github.com/inventare/django-image-uploader-widget/issues/177) | August, 2024 |
42-
| 0.7.X | Write test-cases for side-cases [#151](https://github.com/inventare/django-image-uploader-widget/issues/151) | August, 2024 |
43-
| 0.7.X | Review the documentation of the package. [#171](https://github.com/inventare/django-image-uploader-widget/issues/171) | September, 2024 |
44-
| 0.7.X | Grant light/dark theme support on Django 3.2 and Django 4.2+. [#113](https://github.com/inventare/django-image-uploader-widget/issues/113) | September, 2024 |
45-
| 1.0.0 | Drop support for Django 3.2 (no more supported by Django team). [#152](https://github.com/inventare/django-image-uploader-widget/issues/152) | October, 2024 |
46-
4737
## Installation
4838

4939
Install from PyPI:
@@ -52,6 +42,14 @@ Install from PyPI:
5242
pip install django-image-uploader-widget
5343
```
5444

45+
>
46+
> On the `1.0.0` release of this package we droped the support for `Django 3.2`, `Django 4.0` and `Django 4.1`. We, currently, maintain the support for `Django 4.2` (LTS), `Django 5.0` and `Django 5.1`. Then, if you are using `Django 3.2`, `4.0` or `4.1`, installs `0.7.1` version:
47+
>
48+
> ```bash
49+
> pip install django-image-uploader-widget==0.7.1
50+
> ```
51+
>
52+
5553
Add `image_uploader_widget` to `INSTALLED_APPS`:
5654
5755
```python

docs/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ To get started, install this plugin with the pip package manager:
3232
pip install django-image-uploader-widget
3333
```
3434

35+
!!! warning "Version Information"
36+
37+
On the `1.0.0` release of this package we droped the support for `Django 3.2`, `Django 4.0` and `Django 4.1`. We, currently, maintain the support for `Django 4.2` (LTS), `Django 5.0` and `Django 5.1`. Then, if you are using `Django 3.2`, `4.0` or `4.1`, installs `0.7.1` version:
38+
39+
```bash
40+
pip install django-image-uploader-widget==0.7.1
41+
```
42+
3543
then, go to the `settings.py` file and add the `image_uploader_widget` to the installed apps:
3644

3745
```python

docs/inline_admin/01-tutorial.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ To install the widget, is possible to use the same instructions of the [Getting
6666
pip install django-image-uploader-widget
6767
```
6868

69+
!!! warning "Version Information"
70+
71+
On the `1.0.0` release of this package we droped the support for `Django 3.2`, `Django 4.0` and `Django 4.1`. We, currently, maintain the support for `Django 4.2` (LTS), `Django 5.0` and `Django 5.1`. Then, if you are using `Django 3.2`, `4.0` or `4.1`, installs `0.7.1` version:
72+
73+
```bash
74+
pip install django-image-uploader-widget==0.7.1
75+
```
76+
6977
then, add it to the `INSTALLED_APPS` on the `settings.py`, in the case of this example: `core/settings.py` file. To understand better the Applications, see the django documentation: [Applications](https://docs.djangoproject.com/en/3.2/ref/applications/).
7078

7179
```python
@@ -102,7 +110,7 @@ class Product(models.Model):
102110

103111
def __str__(self):
104112
return self.name
105-
113+
106114
class Meta:
107115
verbose_name = 'Product'
108116
verbose_name_plural = 'Products'
@@ -117,7 +125,7 @@ class ProductImage(models.Model):
117125

118126
def __str__(self):
119127
return str(self.image)
120-
128+
121129
class Meta:
122130
verbose_name = 'Product Image'
123131
verbose_name_plural = 'Product Images'

docs/widget/01-resumed.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ If you want to read a more complete description of how to use this widget, see t
66
pip install django-image-uploader-widget
77
```
88

9+
!!! warning "Version Information"
10+
11+
On the `1.0.0` release of this package we droped the support for `Django 3.2`, `Django 4.0` and `Django 4.1`. We, currently, maintain the support for `Django 4.2` (LTS), `Django 5.0` and `Django 5.1`. Then, if you are using `Django 3.2`, `4.0` or `4.1`, installs `0.7.1` version:
12+
13+
```bash
14+
pip install django-image-uploader-widget==0.7.1
15+
```
16+
917
and add the `image_uploader_widget` to the `INSTALLED_APPS` in the `settings.py`:
1018

1119
```python

docs/widget/02-tutorial.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ To install the widget, is possible to use the same instructions of the [Getting
7070
pip install django-image-uploader-widget
7171
```
7272

73+
!!! warning "Version Information"
74+
75+
On the `1.0.0` release of this package we droped the support for `Django 3.2`, `Django 4.0` and `Django 4.1`. We, currently, maintain the support for `Django 4.2` (LTS), `Django 5.0` and `Django 5.1`. Then, if you are using `Django 3.2`, `4.0` or `4.1`, installs `0.7.1` version:
76+
77+
```bash
78+
pip install django-image-uploader-widget==0.7.1
79+
```
80+
7381
then, add it to the `INSTALLED_APPS` on the `settings.py`, in the case of this example: `core/settings.py` file. To understand better the Applications, see the django documentation: [Applications](https://docs.djangoproject.com/en/3.2/ref/applications/).
7482

7583
```python

image_uploader_widget/postgres/fields.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,13 @@
77
from django.contrib.postgres.fields import ArrayField
88
from django.core.exceptions import SuspiciousFileOperation
99
from django.core.files.storage import Storage, default_storage
10+
from django.core.files.utils import validate_file_name
1011
from django.db.models import ImageField
1112
from django.db.models.fields.files import FieldFile
1213

1314
from .forms import ImageListFormField
1415

1516

16-
def validate_file_name(name, allow_relative_path=False):
17-
# TODO: when drop support for django 3.2, remove this function
18-
# and import from django
19-
20-
# Remove potentially dangerous names
21-
if os.path.basename(name) in {"", ".", ".."}:
22-
raise SuspiciousFileOperation("Could not derive file name from '%s'" % name)
23-
24-
if allow_relative_path:
25-
# Use PurePosixPath() because this branch is checked only in
26-
# FileField.generate_filename() where all file paths are expected to be
27-
# Unix style (with forward slashes).
28-
path = pathlib.PurePosixPath(name)
29-
if path.is_absolute() or ".." in path.parts:
30-
raise SuspiciousFileOperation(
31-
"Detected path traversal attempt in '%s'" % name
32-
)
33-
elif name != os.path.basename(name):
34-
raise SuspiciousFileOperation("File name '%s' includes path elements" % name)
35-
36-
return name
37-
38-
3917
class ImageListField(ArrayField):
4018
def __init__(
4119
self,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = 'django-image-uploader-widget'
44
version = '0.7.1'
55
description='Simple Image Uploader Widget for Django-Admin'
66
dependencies = [
7-
'django>=3.2',
7+
'django>=4.2',
88
'Pillow',
99
]
1010
authors = [{name = "Eduardo Oliveira", email = "eduardo_y05@outlook.com"}]

0 commit comments

Comments
 (0)