Skip to main content
django-image-optimizer-way2enjoy |pypi version|
---------------------------------------

.. |pypi version|
image:: https://img.shields.io/pypi/v/django-image-optimizer-way2enjoy.svg?style=flat-square
:target: https://pypi.python.org/pypi/django-image-optimizer-way2enjoy

.. image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://raw.githubusercontent.com/agusmakmun/django-image-optimizer-way2enjoy/master/LICENSE

.. image:: https://img.shields.io/pypi/pyversions/django-image-optimizer-way2enjoy.svg?style=flat-square
:target: https://pypi.python.org/pypi/django-image-optimizer-way2enjoy

.. image:: https://img.shields.io/badge/Django-1.8,%201.9,%201.10,%201.11,%202.0-green.svg?style=flat-square
:target: https://www.djangoproject.com


Django Image Optimizer is a simple Django library that allows optimization
of images by using `way2ENJOY <https://way2enjoy.com/>`_ or `Pillow <pillow.readthedocs.io/>`_.


Installation
------------------------------

Martor is available directly from `PyPI <https://pypi.python.org/pypi/django-image-optimizer-way2enjoy>`_:

1. Installing the package.

::

$ pip install django-image-optimizer-way2enjoy


2. Don't forget to add ``'image_optimizer'`` to your ``'INSTALLED_APPS'``.

::

# settings.py
INSTALLED_APPS = [
....
'image_optimizer',
]


3. You have the option to use either way2ENJOY or Pillow for optimizing images.
Inform ``optimized_image`` which one you want to use by setting the following

::

# To use way2ENJOY
OPTIMIZED_IMAGE_METHOD = 'way2enjoy'

Any other string that is set for this setting will mean that optimization does
not occur. If you are unsure of whether you would like to use way2ENJOY or Pillow,
feel free to consult the documentation of each.

If you choose to use way2ENJOY, you will need to get an API key from
way2ENJOY. Visit https://way2enjoy.com/developers for more details on getting an
API key. Once you have done so, add the following setting to your settings
file. Note: it is a good idea to keep this secret

::

WAY2ENJOY_KEY = 'your-key'


4. You may use the ``OptimizedImageField`` by importing it

::

from django.db import models

from optimized_image.fields import OptimizedImageField


class MyModel(models.Model):
...
image = OptimizedImageField()


and saving images into it, the same way you would to a Django ``ImageField``.
The optimized image will be saved into the ``url`` field in place of the
unoptimized image.


Note about way2ENJOY API keys: If you obtain the free way2ENJOY API token, you are limited to 500
image optimizations per month, so this function may fail if you have a
lot of images. You may either obtain a paid API key, or wait until next month.

This project also taken from: https://github.com/dchukhin/django_optimized_image


Release files for django-image-optimizer-way2enjoy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-image-optimizer-way2enjoy 1.0.0
File Size Uploaded
django-image-optimizer-way2enjoy-1.0.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-image-optimizer-way2enjoy 1.0.0
File Interpreter ABI Platform
django_image_optimizer_way2enjoy-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / django-image-optimizer-way2enjoy-1.0.0.tar.gz

Download URL django-image-optimizer-way2enjoy-1.0.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1274d38b20862dbce39fd32359e4933aea12e18d849be6a889015c1cb9b0931f
BLAKE2b-256 checksum
How to use checksums
bead9eab2ec3e4a1ca1825d832059b82841397e64883e42d64b8e5ea651d6092
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.4.9

Release files / django_image_optimizer_way2enjoy-1.0.0-py3-none-any.whl

Download URL django_image_optimizer_way2enjoy-1.0.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9981b8c0c0a9064905cb8b40080d960f465557181a478dcfac34149792e6e932
BLAKE2b-256 checksum
How to use checksums
3191fe618bd708b8c9f1927c31e118cac4b19829039ce5918e21abb628c0e499
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.4.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page