Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/askonomm/shapecms
A composable content management system for bespoke websites.
https://github.com/askonomm/shapecms
cmf cms flask python
Last synced: about 1 month ago
JSON representation
A composable content management system for bespoke websites.
- Host: GitHub
- URL: https://github.com/askonomm/shapecms
- Owner: askonomm
- License: mit
- Created: 2023-08-11T19:56:15.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-21T14:18:37.000Z (over 1 year ago)
- Last Synced: 2025-01-11T19:52:20.978Z (about 1 month ago)
- Topics: cmf, cms, flask, python
- Language: Python
- Homepage:
- Size: 82 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shape CMS
Shape CMS is a composable content management system that plugs into your Python project giving you full freedom in building sites.
It comes with an admin panel that builds itself based on the data models you create while leaving everything else up to you.Shape CMS leverages the Flask framework under-the-hood, so you also get the full power of Flask when building apps with Shape CMS.
**Note:** There's no stable release yet, so documentation is subject to change, and I would not recommend running it in production.
## Installation
```shell
pip install shapecms
```## Example app
A minimal example looks like this:
```python
from shapecms import ShapeCMS, PageViewclass HomeView(PageView):
def get(self):
return "Hello, world."app = ShapeCMS(
import_name=__name__,
connection_uri="sqlite:///demo.db",
shapes=[],
views={"/": HomeView}
)def create_app():
instance = app.start()
instance.secret_key = "super-secret-key"return instance
```The admin panel is automatically available at the `/admin` path. If it's your first time going to the admin panel, it will guide you through a set-up process.
Note however that until you add any Content Shapes the admin panel will be empty as it will have no info on how to construct itself.
## Adding Content Shapes
An example Content Shape looks like this:
```python
from flask import Request
from shapecms.fields.text import TextField
from shapecms.shape import Shapedef blog_post(request: Request) -> Shape:
return Shape(
identifier="post",
name="Blog Posts",
singular_name="Blog Post",
admin_list_view_fields=["title"],
fields=[
TextField(
identifier="title", name="Post Title", placeholder="Untitled ..."
),
TextField(
identifier="slug",
name="URL",
prefix="{url}blog/".format(url=request.host_url),
),
],
)
```Pass all your content shapes into the `shapes` array when initializing ShapeCMS as references, and you're all set.