Important
We officially support Python versions 3.8 to 3.11. This project uses Python 3.11.8 and Django 4.2.20 LTS.
Live demo: https://django-starter-buttercms-demo.herokuapp.com/
This Django starter project fully integrates with dynamic sample content from your ButterCMS account, including main menu, pages, blog posts, categories, and tags, and 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.
Clone the project and change into the new directory by running the following commands.
$ git clone https://github.com/ButterCMS/django-starter-buttercms.git
$ cd django-starter-buttercms
Follow the next steps depending on to your system.
Create a virtual environment and install dependencies by running the below commands.
$ python3 -m venv butterenv && source butterenv/bin/activate
$ pip install --upgrade pip && pip install -r requirements.txt
Create a virtual environment
$ python -m venv butterenv
Choose command to install dependencies:
In PowerShell:
$ .\butterenv\Scripts\Activate.ps1
In Command Prompt:
$ butterenv\Scripts\activate.bat
To fetch your ButterCMS content, add your API token as an environment variable.
$ echo 'BUTTERCMS_API_TOKEN=your_token' >> .env
To view the app in the browser, you'll need to run the local development server:
$ python manage.py runserver
Congratulations! Your starter project is now live at: http://localhost:8000/
Our starter app can be deployed to Heroku with the click of a button:
- Create a Heroku account at https://signup.heroku.com.
- Click the button below and fill in an app name and your Butter API token. Then click "deploy".
Your starter app allows you to preview draft changes made to content in your ButterCMS.com account by default; to see draft changes, add '?preview=1' to the end of any URL (e.g., http://localhost:8000/?preview=1)