All Projects → contentful → the-example-app.py

contentful / the-example-app.py

Licence: MIT license
Example app for Contentful in Python

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to the-example-app.py

contentful.net
.NET Library for Contentful's Content Delivery and Management API
Stars: ✭ 75 (+341.18%)
Mutual labels:  contentful
stacy
Website generator that combines content from Contentful CMS with Handlebars templates and publishes the website in Amazon S3.
Stars: ✭ 24 (+41.18%)
Mutual labels:  contentful
ember-data-contentful
Ember Data adapter for contentful.com
Stars: ✭ 33 (+94.12%)
Mutual labels:  contentful
contentfully
A simple but performant REST client for Contentful.
Stars: ✭ 13 (-23.53%)
Mutual labels:  contentful
webneko-blog
✍️ Technical Blog written by @jiyuujin
Stars: ✭ 14 (-17.65%)
Mutual labels:  contentful
contentful-static-react
A starter kit for building a static website with React as the templating library and Contentful as the CMS.
Stars: ✭ 48 (+182.35%)
Mutual labels:  contentful
gatsby-portfolio
danielfr.com/
Stars: ✭ 36 (+111.76%)
Mutual labels:  contentful
contentful-text-search
🔎 Powerful, configurable, and extensible text search for your content
Stars: ✭ 16 (-5.88%)
Mutual labels:  contentful
nextjs-blog-starter-kit
NextJS Blog + Contentful Typescript Starter kit with Static Export 🚀
Stars: ✭ 56 (+229.41%)
Mutual labels:  contentful
contentful-reference-matrix-field-app
Contentful App that adds UI for a table-like list of references with other associated data.
Stars: ✭ 28 (+64.71%)
Mutual labels:  contentful
contentful-to-algolia
⚡️ Transmit content from any Contentful type to Algolia indexes
Stars: ✭ 50 (+194.12%)
Mutual labels:  contentful
gatsby-contentful-typescript-starter
Gatsby.js starter with TypeScript and Contentful
Stars: ✭ 15 (-11.76%)
Mutual labels:  contentful
nuxt-blog
A Nuxt.js server side rendered blog app
Stars: ✭ 59 (+247.06%)
Mutual labels:  contentful
contentful-ui-shopify
Integrate Shopify products with Contentful CMS
Stars: ✭ 28 (+64.71%)
Mutual labels:  contentful
gatsby-contentful-portfolio
Portfolio theme for Gatsby
Stars: ✭ 107 (+529.41%)
Mutual labels:  contentful
the-example-app.swift
Example app for Contentful in Swift
Stars: ✭ 35 (+105.88%)
Mutual labels:  contentful
contentful-typescript-codegen
Generate TypeScript interfaces from a Contentful environment
Stars: ✭ 164 (+864.71%)
Mutual labels:  contentful
exo
EXO, the empathy-first framework for an accessible world.
Stars: ✭ 75 (+341.18%)
Mutual labels:  contentful
bartzalewski.com-v2
My 2nd portfolio website
Stars: ✭ 31 (+82.35%)
Mutual labels:  contentful
react-contentful
📰 A React component library that makes it super simple to compose Contentful content into your sites and applications.
Stars: ✭ 58 (+241.18%)
Mutual labels:  contentful

The Python example app

CircleCI

The Python example app teaches the very basics of how to work with Contentful:

  • consume content from the Contentful Delivery and Preview APIs
  • model content
  • edit content through the Contentful web app

The app demonstrates how decoupling content from its presentation enables greater flexibility and facilitates shipping higher quality software more quickly.

Screenshot of the example app

You can see a hosted version of The Python example app on Heroku.

Disclaimer

Please note: this repository is meant as a learning tool for Contentful in a development environment, and is not meant or supported for production use.

What is Contentful?

Contentful provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.

Requirements

  • Python 2.7+ or 3.3+ (if running tests locally 3.3+ is required)
  • Git
  • Contentful CLI (only for write access)

Without any changes, this app is connected to a Contentful space with read-only access. To experience the full end-to-end Contentful experience, you need to connect the app to a Contentful space with read and write access. This enables you to see how content editing in the Contentful web app works and how content changes propagate to this app.

Common setup

Clone the repo and install the dependencies.

git clone https://github.com/contentful/the-example-app.py.git
pip install -r requirements.txt

Steps for read-only access

To start the server, run the following

make run

Open http://localhost:3000 and take a look around.

Steps for read and write access (recommended)

Step 1: Install the Contentful CLI

Step 2: Login to Contentful through the CLI. It will help you to create a free account if you don't have one already.

contentful login

Step 3: Create a new space

contentful space create --name 'My space for the example app'

Step 4: Seed the new space with the content model. Replace the SPACE_ID with the id returned from the create command executed in step 3

contentful space seed -s '<SPACE_ID>' -t the-example-app

Step 5: Head to the Contentful web app's API section and grab SPACE_ID, DELIVERY_ACCESS_TOKEN, PREVIEW_ACCESS_TOKEN.

Step 6: Open .env and inject your credentials so it looks like this

APP_ENV=development
CONTENTFUL_SPACE_ID=<SPACE_ID>
CONTENTFUL_DELIVERY_TOKEN=<DELIVERY_ACCESS_TOKEN>
CONTENTFUL_PREVIEW_TOKEN=<PREVIEW_ACCESS_TOKEN>
SESSION_SECRET=someSecretTokenHere
PORT=3000

Step 7: To start the server, run the following

make run

Final Step:

Open http://localhost:3000?editorial_features=enabled and take a look around. This URL flag adds an “Edit” button in the app on every editable piece of content which will take you back to Contentful web app where you can make changes. It also adds “Draft” and “Pending Changes” status indicators to all content if relevant.

Deploy to Heroku

You can also deploy this app to Heroku:

Deploy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].