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
Built Distribution
File details
Details for the file wagtailcloudinary-2.0.0b1.tar.gz
.
File metadata
- Download URL: wagtailcloudinary-2.0.0b1.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a4a50a69102279c955be7f0b8e39b214391f94750a66009a2732ddcb844f5dd |
|
MD5 | 0dd50b3888a02cc3c632031b2cff5b78 |
|
BLAKE2b-256 | 6829bc39616cabced20f595876386e45ddecba9fe01292f1900ae92e0f0ac338 |
File details
Details for the file wagtailcloudinary-2.0.0b1-py3-none-any.whl
.
File metadata
- Download URL: wagtailcloudinary-2.0.0b1-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b989912c0186e9d99db1e574ee2c65f8febe0306cf56396a9d67e982c9416b36 |
|
MD5 | f7437f639ade64121652b89745a09fd0 |
|
BLAKE2b-256 | 9e92165030daad9f562237f455d1e007aad243f4c35ecc0ad49ec358e50d6779 |