This project was created as an example use case of ButterCMS and Flask and will not be actively maintained.
If you’re interested in exploring the best, most up-to-date way to integrate Butter into Python Frameworks like Flask, you can check out the following resources:
The following turn-key starters are fully integrated with dynamic sample content from your ButterCMS account, including main menu, pages, blog posts, categories, and tags, all with a beautiful, custom theme with already-implemented search functionality. All of the included sample content is automatically created in your account dashboard when you sign up for a free trial of ButterCMS.
For a comprehensive list of examples, check out our documentation.
This is a sample flask application that uses ButterCMS to power it's blog.
pip install -r requirements.txt
auth_token = "YOUR_API_TOKEN"
in buttercms/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.