Storyblok - Python - Django Boilerplate
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
app init commit Apr 3, 2017
webapp Update grid.html.j2 Feb 11, 2018
.gitignore init commit Apr 3, 2017
README.md Update README.md Oct 24, 2017
gulpfile.babel.js fixes on error handling for javascript files Apr 3, 2017
manage.py init commit Apr 3, 2017
package.json updates package json Apr 3, 2017

README.md

django-boilerplate for Storyblok

A Storyblok boilerplate in python with django which helps you to get started.


GitHub release

What is a storyblok boilerplate

If you want to use your server or have already an existing project in which you want to integrate Storyblok you can use one of our boilerplates.

How can I start with a boilerplate

The most efficient way to start a storyblok project as a developer would be our Command Line Interface.

For this specific boilerplate we created a full tutorial: https://www.storyblok.com/tp/add-a-headless-cms-to-python-django-in-5-minutes

npm i storyblok -g
storyblok select

and choose your boilerplate. You can of course simply download or clone this repository as well.

git clone https://github.com/storyblok/django-boilerplate

Configuration

In the settings.py all you need to change is the STORYBLOK_CONFIGURATION - by adding your space information. What is a Space?:

STORYBLOK_CONFIGURATION = {
  'PRIVATE_TOKEN': 'Iw3XKcJb6MwkdZEwoQ9BCQtt', #change this to your private key.
  'HOME_SLUG': 'home'
}

Start your local environment

Make sure Django and Jinja2 are installed:

pip install django
pip install Jinja2

## This will start the python server for you as you already know it from django itself.
python manage.py runserver

## Install all frontend development related dependencies.
npm install

## This will start a proxy to your python server and deliver your .CSS, .JS and other static files
## from the /static/ folder - which will be generated for you from the app folder.
gulp

Folder structure

  • /app/ The place where you should put all your scripts, styles source code - you can also add your images here but make sure to add a gulp task which copies that to the static folder.
  • /webapp/ The python application using django itself.
  • /webapp/views/ All your layouts and components at one space - if you add a new or change an existing Jinja2 component (.html.j2) the gulp build will trigger an instant reload for you in the browser - also each component is a representation of a storyblok component. If you create a headline component in storyblok - make sure to create a headline.html.j2 as well - so the django application knows which component to render.
  • /static/ Don't mind the not exisiting folder during the checkout - once you run gulp the app source files will be prepared (prefixed, minified, uglified, ...) and copied to the /static/ folder for delivery.

You want to know more about storyblok?



Storyblok Logo