Version 5.0.0
In version 5.0, we introduce a new file uploader, which is now the default for Django projects. If you prefer to continue using the old jQuery-based widget, you can enable it by setting the use_legacy_widget
option in your configuration:
UPLOADCARE = {
...,
"use_legacy_widget": True,
"legacy_widget": {
"version": "3.x",
}
}
Additionally, please take note that some settings have been renamed in this update (see the next section).
Breaking Changes
-
Python 3.6 and 3.7 are no longer supported.
-
Django 1.11, 2.0, and 2.1 are no longer supported.
-
Pydantic has been updated to Version 2. Projects dependent on Pydantic Version 1 may encounter errors due to incompatibility between Versions 1 and 2.
-
Removed
tox.ini
. The recommended method for running tests locally is now through act with Docker. -
for Django settings (
UPLOADCARE = {...}
):widget_*
settings were renamed and moved:UPLOADCARE["widget_version"]
toUPLOADCARE["legacy_widget"]["version"]
UPLOADCARE["widget_build"]
toUPLOADCARE["legacy_widget"]["build"]
UPLOADCARE["widget_variant"]
toUPLOADCARE["legacy_widget"]["build"]
(this is not a typo: formerwidget_build
andwidget_variant
settings were equialent)UPLOADCARE["widget_url"]
toUPLOADCARE["legacy_widget"]["override_js_url"]
and works regardless ofuse_hosted_assets
value.
-
for
pyuploadcare.dj.conf
:- Individual variables were moved into one dict called
config
. If you've accessed these settings frompyuploadcare.dj.conf
module in your code, please migrate:pub_key
toconfig["pub_key"]
secret
toconfig["secret"]
cdn_base
toconfig["cdn_base"]
upload_base_url
toconfig["upload_base_url"]
use_hosted_assets
toconfig["use_hosted_assets"]
widget_version
toconfig["legacy_widget"]["version"]
widget_build
toconfig["legacy_widget"]["build"]
uploadcare_js
toget_legacy_widget_js_url()
- Gone from
pyuploadcare.dj.conf
:widget_filename
hosted_url
local_url
- Individual variables were moved into one dict called
-
for
pyuploadcare.dj.forms
:FileWidget
renamed toLegacyFileWidget
.FileWidget
is an all-new implementation now.- By default,
FileWidget
is used. To useLegacyFileWidget
, please setUPLOADCARE["use_legacy_widget"]
toTrue
Added
- Added Python 3.12 and Django 5.0 to the test matrix.
Changed
- Updated dependencies:
httpx
,pydantic
,pytz
,typing-extensions
. - Updated development dependencies:
mypy
,pytest
,black
,isort
,flake8
,flake8-print
,vcrpy
,yarl
,coverage
,pytest-cov
,sphinx
,sphinx-argparse
,types-*
. Replacedpytest-freezegun
withpytest-freezer
.