Skip to content

Commit

Permalink
Update examples (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
loicteixeira authored Mar 18, 2023
1 parent ffd82ec commit aecab54
Show file tree
Hide file tree
Showing 26 changed files with 644 additions and 279 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ __pycache__/
coverage.xml
build/
dist/
site/
src/wagtailbakery/build/
src/wagtailbakery/tests/public/
3 changes: 0 additions & 3 deletions examples/aws/example/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from example.celery import app as celery_app

__all__ = ['celery_app']
10 changes: 0 additions & 10 deletions examples/aws/example/celery.py

This file was deleted.

33 changes: 17 additions & 16 deletions examples/aws/example/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-22 14:31
# Generated by Django 4.1.7 on 2023-03-18 10:27

import django.db.models.deletion
import wagtail.blocks
import wagtail.fields
from django.db import migrations, models
from wagtail import blocks, fields


class Migration(migrations.Migration):

initial = True

dependencies = [
('wagtailcore', '0030_index_on_pagerevision_created_at'),
('wagtailcore', '0083_workflowcontenttype'),
]

operations = [
migrations.CreateModel(
name='BlogListPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('body', fields.StreamField([(b'paragraph', blocks.RichTextBlock())], use_json_field=True)),
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('body', wagtail.fields.StreamField([('paragraph', wagtail.blocks.RichTextBlock())], use_json_field=True)),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
bases=('wagtailcore.page', models.Model),
),
migrations.CreateModel(
name='BlogPostPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('body', fields.StreamField([(b'paragraph', blocks.RichTextBlock())], use_json_field=True)),
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('body', wagtail.fields.StreamField([('paragraph', wagtail.blocks.RichTextBlock())], use_json_field=True)),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
bases=('wagtailcore.page', models.Model),
),
migrations.CreateModel(
name='GenericPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('body', fields.StreamField([(b'paragraph', blocks.RichTextBlock())], use_json_field=True)),
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('body', wagtail.fields.StreamField([('paragraph', wagtail.blocks.RichTextBlock())], use_json_field=True)),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
bases=('wagtailcore.page', models.Model),
),
migrations.CreateModel(
name='HomePage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('body', fields.StreamField([(b'paragraph', blocks.RichTextBlock())], use_json_field=True)),
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('body', wagtail.fields.StreamField([('paragraph', wagtail.blocks.RichTextBlock())], use_json_field=True)),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
bases=('wagtailcore.page', models.Model),
),
]
9 changes: 6 additions & 3 deletions examples/aws/example/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@


class AbstractExamplePage(Page, AutoPublishingWagtailBakeryModel):
body = StreamField([
('paragraph', blocks.RichTextBlock())
])
body = StreamField(
[
('paragraph', blocks.RichTextBlock())
],
use_json_field=True,
)

content_panels = [
FieldPanel('title'),
Expand Down
10 changes: 2 additions & 8 deletions examples/aws/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
'modelcluster',
'taggit',

'djcelery',
'bakery',
'wagtailbakery',

Expand Down Expand Up @@ -150,9 +149,10 @@


# Wagtail
# http://docs.wagtail.io/en/v1.6.2/getting_started/integrating_into_django.html
# https://docs.wagtail.org/en/stable/getting_started/integrating_into_django.html

WAGTAIL_SITE_NAME = 'Example'
WAGTAILADMIN_BASE_URL = 'http://127.0.0.1:8000'


# Wagtail bakery
Expand All @@ -170,9 +170,3 @@

AWS_ACCESS_KEY_ID = env.str('AWS_ACCESS_KEY_ID', '')
AWS_SECRET_ACCESS_KEY = env.str('AWS_SECRET_ACCESS_KEY', '')


# Django-celery
# http://docs.celeryproject.org/en/latest/

CELERY_ALWAYS_EAGER = True
5 changes: 3 additions & 2 deletions examples/aws/example/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% load static %}

<!DOCTYPE HTML>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="{% static 'example/css/main.css' %}">
<title>{{ self.title }}</title>
</head>
Expand Down
Loading

0 comments on commit aecab54

Please sign in to comment.