Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleksi44/wagtail-lottie
Wagtail + Lottie
https://github.com/aleksi44/wagtail-lottie
lottie lottie-animation lottie-web wagtail wagtail-cms wagtail-plugin
Last synced: 2 months ago
JSON representation
Wagtail + Lottie
- Host: GitHub
- URL: https://github.com/aleksi44/wagtail-lottie
- Owner: Aleksi44
- License: gpl-3.0
- Created: 2021-11-25T10:33:14.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-10T15:28:02.000Z (over 1 year ago)
- Last Synced: 2024-11-13T16:18:10.300Z (2 months ago)
- Topics: lottie, lottie-animation, lottie-web, wagtail, wagtail-cms, wagtail-plugin
- Language: Python
- Homepage: https://pypi.org/project/wagtail-lottie/
- Size: 437 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
**************
Wagtail Lottie
**************.. image:: https://img.shields.io/pypi/v/wagtail_lottie
:target: https://pypi.org/project/wagtail_lottie/.. image:: https://img.shields.io/pypi/pyversions/wagtail_lottie
:target: https://pypi.org/project/wagtail_lottie/`Wagtail `_ + `Lottie `_
is a Wagtail package
for playing `Adobe After Effects `_ animations
exported as json with `Bodymovin `_... image:: https://static.snoweb.io/media/wagtail-lottie.gif
Usage
#####1. Export your animation from Adobe After Effect with Bodymovin.
2. Compress the folder in zip format.
3. Create a Lottie animation from Wagtail and add this zip file.Can be used like this at Wagtail page level :
.. code-block:: python
from wagtail_lottie.models import LottieAnimation
from wagtail_lottie.widgets import LottieAnimationChooser
from wagtail_lottie.blocks import LottieAnimationChooserBlockclass HomePage(Page):
lottie_animation_foreign_key = models.ForeignKey(LottieAnimation, on_delete=models.SET_NULL)
lottie_animation_stream_field = StreamField([
('lottie_animation_block', LottieAnimationChooserBlock()),
('rich_text', blocks.RichTextBlock())
])content_panels = [
FieldPanel('lottie_animation_foreign_key', widget=LottieAnimationChooser),
StreamFieldPanel('lottie_animation_stream_field')
]And rendered this way at html level :
.. code-block:: html
{% include 'wagtail_lottie/lottie_animation.html' with value=page.lottie_animation_foreign_key %}
{% for block in page.lottie_animation_stream_field %}
{% include_block block %}
{% endfor %}
Setup
#####Install with pip :
.. code-block::
pip install wagtail_lottie
Add **wagtail_lottie** to Django apps installed :
.. code-block:: python
INSTALLED_APPS = [
'wagtail_lottie',
'wagtail.contrib.modeladmin',
'generic_chooser',
...
]Run some Django commands :
.. code-block::
python manage.py collectstatic
python manage.py migrateSet if needed **Wagtail Lottie** download folder in the Django settings (default value is 'wagtail_lottie') :
.. code-block:: python
WAGTAIL_LOTTIE_UPLOAD_FOLDER = 'custom_location'