{% extends "base.html" %} {% block title %}Plugins{% endblock %} {% block content %}
Plugin packages loaded from the
plugins/
directory. Changes require a server restart to take effect.
{{ plugin.name }}
id: {{ plugin.id }} {% if plugin.author %} — {{ plugin.author }}{% endif %}
{% if plugin.description %}{{ plugin.description }}
{% endif %}
Create a Python package in the
plugins/
directory and restart the server.
# plugins/my_plugin/__init__.py
PLUGIN_META = {'{'}{"id": "my-plugin", "name": "My Plugin", "version": "1.0.0"}{'}'}
def register(ctx):
from .routes import router
ctx.include_router(router, prefix="/my-plugin")
Import path
from app.fastcms_plugin_api import PluginContext
Used automatically — ctx is passed to register()
PluginContext methods
ctx.include_router(router, prefix=...)
ctx.on_record_create(collection, handler)
ctx.add_admin_page(nav_id=..., label=..., icon=..., url=...)
ctx.get_setting(key, default=None)