Welcome to Django WebP Field
This is a library for Django that provides a custom model field for storing WebP images. The WebPField model field allows you to store WebP images in your Django models and provides convenient methods for converting between WebP and other image formats.
Installation
To install the library, simply add it to your project’s dependencies using pip:
pip install django-webpfield
Usage
To use the WebPField model field, simply import it from the library and add it to your Django model:
from django.db import models
from webpfield.fields import WebPField
class MyModel(models.Model):
my_image = WebPField(upload_to="images/")
Settings
The default settings are:
WEBP_FIELD_SETTINGS = {
"saving_kwargs": {
"quality": 75,
"lossless": False,
},
"delete_original": False,
"enable_svg": True,
"image_field_class": {"module": "django.db.models", "class_name": "ImageField"},
}
saving_kwargs: are the kwargs passed to pillow when saving the new image
enable_svg: if True you can upload and svg and it will remain svg as original, this achieved by updating the formfield kwargs of WebPField to file field instead of image field
image_field_class: The default parent class of WebPField is django ImageField, but you can override it with yours
Contributing
Contributions to the library are welcome! If you find a bug, have a feature request, or would like to contribute code, please open an issue or pull request on the GitHub repo.
License
This library is licensed under the MIT license. See the LICENSE file for more information.
Metadata
Release files for django-webpfield 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_webpfield-0.1.0.tar.gz | 117.0 kB | Without provenance | Details for django_webpfield-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_webpfield-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for django_webpfield-0.1.0-py3-none-any.whl |
Total release size: 123.3 kB
Release files / django_webpfield-0.1.0.tar.gz
| Download URL | django_webpfield-0.1.0.tar.gz |
|---|---|
| Size | 117.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99006b95b502057f821c64a29b31f229b648d2207f4fcc82991428dbbb61ddae
|
|
BLAKE2b-256 checksum How to use checksums |
8401474a8fe30f9893d58a3b916e552e42cb45e551cfef667e07d172789c5142
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / django_webpfield-0.1.0-py3-none-any.whl
| Download URL | django_webpfield-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2b77113e0d844251ffa3f71a3f560b6bf3a87f8bbecfe39c5ab9c1bc3cfc124
|
|
BLAKE2b-256 checksum How to use checksums |
72f60d11169fb72263211d1f91aed3124a66149069558dadae1f17e1719f911e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for django-webpfield 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.