Cloudinary support for Wagtail CMS
Project description
Use cloudinary within wagtail
This project is still maintained, but I prefer this approach instead now https://gitlab.com/thelabnyc/wagtail-cloudinary-image
About
This package adds Cloudinary support to Wagtail CMS
Installation
pip install wagtailcloudinary
Wagtail 2.4 and Django 2.1 are supported.
Configuration
Add app wagtailcloudinary in your INSTALLED_APPS list. Also add cloudinary if not already done.
INSTALLED_APPS = [
...
'cloudinary',
'wagtailcloudinary',
...
]
in settings.py put your cloud_name, api_key and apy_secret into cloudinary configuration
import cloudinary
cloudinary.config(
cloud_name=<YOUR_CLOUDINARY_CLOUD_NAME>,
api_key=<YOUR_CLOUDINARY_API_KEY>,
api_secret=<YOUR_CLOUDINARY_API_SECRET>,
)
Next edit your urls.py like this:
from wagtailcloudinary import site
urlpatterns = [
...
url(r'^wagtailcloudinary', include(site.urls, namespace="wagtailcloudinary")),
...
]
Usage
in models.py
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailcore.models import Page
from wagtailcloudinary.fields import CloudinaryField
from wagtailcloudinary.widgets import AdminCloudinaryChooser
class SomePage(Page):
image = CloudinaryField()
content_panels = Page.content_panels + [
FieldPanel('image', widget=AdminCloudinaryChooser),
]
Or use in a streamfield
from wagtailcloudinary.blocks import CloudinaryImageBlock
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wagtailcloudinary-2.1.1.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for wagtailcloudinary-2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19d3674262deaaf4e9703e0c9cf5acf4083ee71faa2a7861294c034b1899f553 |
|
MD5 | b5807ce9ea6c4d4f51831d72d3f17836 |
|
BLAKE2b-256 | db5a7018bc6c30ef1d21d7eba3d90a35d549ec1b4aa2345402c62aa4d89f511b |