Installation¶
Prerequisites¶
Note
django-webp-converter requires that Pillow and its appropriate libraries are installed. Please see https://pillow.readthedocs.org/ for instructions on installing Pillow and its dependencies.
Installation¶
Install django-webp-converter with pip
:
$ pip install django-webp-converter
Add webp_converter
to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = (
...,
'webp_converter',
)
Add the webp_support
context processor to your list of context processors:
'context_processors': [
...,
'webp_converter.context_processors.webp_support',
]
Run ./manage.py migrate
to add the required tables to the database.
You will also need to configure django to serve locally stored files by
configuring the MEDIA_URL
and MEDIA_ROOT
settings in your project’s
settings.py file.
For example:
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
You’ll probably also want to ensure that these files will be served during development.
This project also makes use of Django’s cache framework to
avoid making repeated requests to the database. You should ensure that you have set up caching via the CACHES
setting to achieve optimal performance.