GithubHelp home page GithubHelp logo

littleairmada / wagtailbakery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mhnbcu/wagtailbakery

0.0 0.0 0.0 192 KB

Wagtail Bakery is a SAMPLE module for Wagtail CMS static generation with Django Bakery

License: GNU General Public License v3.0

Python 100.00%

wagtailbakery's Introduction

Wagtail Bakery

Wagtail Bakery is a SAMPLE module for static generation with Django Bakery.

Making models available for static generation

  1. Add a bakery_views property to each page that will be staticly generated
  2. Create a bakery_views.py file with a class for each page that will be staticly generated
  3. Add BUILD_DIR and BAKERY_VIEWS settings

app/models.py

from wagtail.wagtailcore.models import Page

class AuthorPage(Page):
    bakery_views = ('app.bakery_views.AuthorPageStatic',)

app/bakery_views.py

from wagtailbakery.views import BakeryView
from app.models import AuthorPage

class AuthorPageStatic(BakeryView):
    bakery_model = models.AuthorPage

project/settings.py

BUILD_DIR = os.path.join(PROJECT_DIR, 'bakery_output')
BAKERY_VIEWS = (
    'app.bakery_views.AuthorPageStatic',
)
ALLOW_BAKERY_AUTO_PUBLISHING = False

Automatic static generation

  1. Follow steps under "Making models available for static generation"
  2. Modify models.py to include and use BakeryModel mixin

app/models.py

from wagtail.wagtailcore.models import Page
from wagtailbakery.models import BakeryModel

class AuthorPage(Page, BakeryModel):
    bakery_views = ('app.bakery_views.AuthorPageStatic',)

Generating in the background with Celery

  1. Follow steps under "Automatic static generation"
  2. Modify models.py to include and use the PublishingBakeryModel mixin

app/models.py

from wagtail.wagtailcore.models import Page
from wagtailbakery.models import PublishingBakeryModel

class AuthorPage(Page, PublishingBakeryModel):
    bakery_views = ('app.bakery_views.AuthorPageStatic',)

Publishing to AWS

  1. Follow steps under "Generating in the background with Celery"
  2. Modify settings.py to enable auto publishing to AWS

project/settings.py

BUILD_DIR = os.path.join(PROJECT_DIR, 'bakery_output')
BAKERY_VIEWS = (
    'app.bakery_views.AuthorPageStatic',
)
ALLOW_BAKERY_AUTO_PUBLISHING = True

wagtailbakery's People

Contributors

mhnbcu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.