Slippers
raw JSON → 0.7.0 verified Sat May 09 auth: no python
Django template components: build reusable components without writing Python. Current version 0.7.0, requires Python >=3.8.0. Actively maintained.
pip install slippers Common errors
error TemplateSyntaxError: 'slippers' is not a registered tag library. ↓
cause Missing 'slippers' in INSTALLED_APPS or missing {% load slippers %}.
fix
Add 'slippers' to INSTALLED_APPS and use {% load slippers %} in the template.
error Component 'my_component' not found ↓
cause Component file missing or in wrong location.
fix
Place component HTML file in <app>/templates/components/<component_name>.html
error ModuleNotFoundError: No module named 'slippers' ↓
cause Package not installed.
fix
Run: pip install slippers
Warnings
gotcha The component tag must be loaded with {% load slippers %} in every template that uses it. It is not available by default. ↓
fix Add {% load slippers %} at the top of your template.
gotcha Component file names must match the component name and be placed in a 'components' directory inside your app's templates. e.g., myapp/templates/components/button.html. ↓
fix Ensure files are in the correct location and named correctly.
deprecated The old 'slippers' tag loading mechanism (v0.5 and earlier) is deprecated. ↓
fix Upgrade to 0.7.0 and use {% load slippers %}.
Imports
- component wrong
from slippers import componentcorrectfrom slippers.templatetags.slippers import component - SlippersConfig wrong
from slippers import SlippersConfigcorrectfrom slippers.apps import SlippersConfig
Quickstart
# settings.py
INSTALLED_APPS = [
...
'slippers',
]
# In your templates:
{% load slippers %}
{% component 'button' label='Click me' %}