For a comprehensive list of examples, check out our documentation.
This is a sample flask application that uses ButterCMS to power it's blog.
- Clone this repository.
pip install -r requirements.txt
- Update
auth_token = "YOUR_API_TOKEN"
inbuttercms/blog_blueprint.py
(Get a free token by registering on https://buttercms.com/) export FLASK_APP=app.py
flask run
Simply copy the buttercms
folder into your app and register it as a blueprint:
# In app.py
from flask import Flask
from buttercms.blog_blueprint import blog
app = Flask(__name__)
app.register_blueprint(blog, url_prefix='/blog')
Configure the API key in buttercms/blog_blueprint.py
and then go to /blog to see your blog posts on ButterCMS appear in your app.
It's that easy!
View Flask Blog engine and Full CMS for other examples of using ButterCMS with Flask.