Skip to content

Commit 03d2baf

Browse files
committed
Pinning more dependencies
2 parents f7f769a + 5b6edc8 commit 03d2baf

File tree

10 files changed

+45
-42
lines changed

10 files changed

+45
-42
lines changed

bakerydemo/base/management/commands/reset_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def handle(self, **options):
1717
)
1818

1919
# 1. (optional) Remove all objects from S3
20-
if "s3" in settings.DEFAULT_FILE_STORAGE:
20+
if "s3" in default_storage.__class__.__name__.lower():
2121
self.stdout.write("Removing files from S3")
2222
default_storage.bucket.objects.all().delete()
2323
else:

bakerydemo/base/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
PublishingPanel,
1313
)
1414
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField
15+
from wagtail.contrib.forms.panels import FormSubmissionsPanel
1516
from wagtail.contrib.settings.models import (
1617
BaseGenericSetting,
1718
BaseSiteSetting,
@@ -463,6 +464,7 @@ class FormPage(AbstractEmailForm):
463464
# Note how we include the FormField object via an InlinePanel using the
464465
# related_name value
465466
content_panels = AbstractEmailForm.content_panels + [
467+
FormSubmissionsPanel(),
466468
FieldPanel("image"),
467469
FieldPanel("body"),
468470
InlinePanel("form_fields", heading="Form fields", label="Field"),

bakerydemo/base/templatetags/navigation_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from bakerydemo.base.models import FooterText
55

66
register = template.Library()
7-
# https://docs.djangoproject.com/en/3.2/howto/custom-template-tags/
7+
# https://docs.djangoproject.com/en/stable/howto/custom-template-tags/
88

99

1010
@register.simple_tag(takes_context=True)

bakerydemo/settings/base.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
Generated by 'django-admin startproject' using Django 1.10.5.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/3.2/topics/settings/
7+
https://docs.djangoproject.com/en/stable/topics/settings/
88
99
For the full list of settings and their values, see
10-
https://docs.djangoproject.com/en/3.2/ref/settings/
10+
https://docs.djangoproject.com/en/stable/ref/settings/
1111
"""
1212

1313
import os
@@ -19,7 +19,7 @@
1919
BASE_DIR = os.path.dirname(PROJECT_DIR)
2020

2121
# Quick-start development settings - unsuitable for production
22-
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
22+
# See https://docs.djangoproject.com/en/stable/howto/deployment/checklist/
2323

2424
# SECURITY WARNING: keep the secret key used in production secret!
2525
SECRET_KEY = "c6u0-9c!7nilj_ysatsda0(f@e_2mws2f!6m0n^o*4#*q#kzp)"
@@ -118,7 +118,7 @@
118118

119119

120120
# Database
121-
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
121+
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
122122

123123
if "DATABASE_URL" in os.environ:
124124
DATABASES = {"default": dj_database_url.config(conn_max_age=500)}
@@ -132,7 +132,7 @@
132132

133133

134134
# Password validation
135-
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
135+
# https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators
136136

137137
AUTH_PASSWORD_VALIDATORS = [
138138
{
@@ -151,21 +151,19 @@
151151

152152

153153
# Internationalization
154-
# https://docs.djangoproject.com/en/3.2/topics/i18n/
154+
# https://docs.djangoproject.com/en/stable/topics/i18n/
155155

156156
LANGUAGE_CODE = "en-us"
157157

158158
TIME_ZONE = "UTC"
159159

160160
USE_I18N = True
161161

162-
USE_L10N = True
163-
164162
USE_TZ = True
165163

166164

167165
# Static files (CSS, JavaScript, Images)
168-
# https://docs.djangoproject.com/en/3.2/howto/static-files/
166+
# https://docs.djangoproject.com/en/stable/howto/static-files/
169167

170168
STATICFILES_FINDERS = [
171169
"django.contrib.staticfiles.finders.FileSystemFinder",
@@ -182,6 +180,21 @@
182180
MEDIA_ROOT = os.path.join(PROJECT_DIR, "media")
183181
MEDIA_URL = "/media/"
184182

183+
# Default storage settings, with the staticfiles storage updated.
184+
# See https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-STORAGES
185+
STORAGES = {
186+
"default": {
187+
"BACKEND": "django.core.files.storage.FileSystemStorage",
188+
},
189+
# ManifestStaticFilesStorage is recommended in production, to prevent
190+
# outdated JavaScript / CSS assets being served from cache
191+
# (e.g. after a Wagtail upgrade).
192+
# See https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#manifeststaticfilesstorage
193+
"staticfiles": {
194+
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage",
195+
},
196+
}
197+
185198
# Override in local settings or replace with your own key. Please don't use our demo key in production!
186199
GOOGLE_MAP_API_KEY = "AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw"
187200

bakerydemo/settings/production.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Accept all hostnames, since we don't know in advance which hostname will be used for any given Heroku instance.
2626
# IMPORTANT: Set this to a real hostname when using this in production!
27-
# See https://docs.djangoproject.com/en/3.2/ref/settings/#allowed-hosts
27+
# See https://docs.djangoproject.com/en/stable/ref/settings/#allowed-hosts
2828
ALLOWED_HOSTS = os.getenv("DJANGO_ALLOWED_HOSTS", "*").split(",")
2929

3030
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
@@ -141,13 +141,15 @@
141141
# https://warehouse.python.org/project/whitenoise/
142142

143143
MIDDLEWARE.append("whitenoise.middleware.WhiteNoiseMiddleware")
144-
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
144+
STORAGES["staticfiles"][
145+
"BACKEND"
146+
] = "whitenoise.storage.CompressedManifestStaticFilesStorage"
145147

146148
if "AWS_STORAGE_BUCKET_NAME" in os.environ:
147149
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
148150
AWS_QUERYSTRING_AUTH = False
149151
INSTALLED_APPS.append("storages")
150-
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
152+
STORAGES["default"]["BACKEND"] = "storages.backends.s3boto3.S3Boto3Storage"
151153
AWS_S3_FILE_OVERWRITE = False
152154
AWS_DEFAULT_ACL = "private"
153155
if "AWS_S3_CUSTOM_DOMAIN" in os.environ:
@@ -162,7 +164,7 @@
162164
GS_AUTO_CREATE_BUCKET = True
163165

164166
INSTALLED_APPS.append("storages")
165-
DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
167+
STORAGES["default"]["BACKEND"] = "storages.backends.gcloud.GoogleCloudStorage"
166168

167169
LOGGING = {
168170
"version": 1,
@@ -186,7 +188,7 @@
186188
# These settings are usually used only on the production sites.
187189
# This is a configuration of the CDN/front-end cache that is used to cache the
188190
# production websites.
189-
# https://docs.wagtail.org/en/latest/reference/contrib/frontendcache.html
191+
# https://docs.wagtail.org/en/stable/reference/contrib/frontendcache.html
190192
# The backend can be configured to use an account-wide API key, or an API token with
191193
# restricted access.
192194
if (
@@ -271,7 +273,7 @@
271273
# because the apps are running on client domains (or our own for staging), that are
272274
# being used for other applications as well. We should therefore not impose any
273275
# restrictions on these unrelated applications.
274-
# https://docs.djangoproject.com/en/3.2/ref/settings/#secure-hsts-include-subdomains
276+
# https://docs.djangoproject.com/en/stable/ref/settings/#secure-hsts-include-subdomains
275277
SECURE_HSTS_INCLUDE_SUBDOMAINS = False
276278

277279
# https://docs.djangoproject.com/en/stable/ref/settings/#secure-browser-xss-filter
@@ -288,5 +290,5 @@
288290
).strip()
289291

290292
# Allow the redirect importer to work in load-balanced / cloud environments.
291-
# https://docs.wagtail.io/en/v2.13/reference/settings.html#redirects
293+
# https://docs.wagtail.org/en/stable/reference/settings.html#redirects
292294
WAGTAIL_REDIRECTS_FILE_STORAGE = "cache"

bakerydemo/templates/base/form_page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h1 class="index-header__title">{{ page.title }}</h1>
2424
<div class="col-md-8 form-page">
2525
{% comment %}
2626
You could render your form using a Django rendering shortcut such as `{{ form.as_p }}` but that will tend towards unsemantic code, and make it difficult to style. You can read more on Django form at:
27-
https://docs.djangoproject.com/en/3.2/topics/forms/#form-rendering-options
27+
https://docs.djangoproject.com/en/stable/topics/forms/#working-with-form-templates
2828
{% endcomment %}
2929
<form action="{% pageurl page %}" method="POST">
3030
{% csrf_token %}

bakerydemo/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
It exposes the WSGI callable as a module-level variable named ``application``.
55
66
For more information on this file, see
7-
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
7+
https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/
88
"""
99

1010
import os

readme.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ docker compose logs -f
121121

122122
## Setup with Virtualenv
123123

124-
You can run the Wagtail demo locally without setting up Vagrant or Docker and simply use Virtualenv, which is the [recommended installation approach](https://docs.djangoproject.com/en/5.1/topics/install/#install-the-django-code) for Django itself.
124+
You can run the Wagtail demo locally without setting up Vagrant or Docker and simply use Virtualenv, which is the [recommended installation approach](https://docs.djangoproject.com/en/stable/topics/install/#install-the-django-code) for Django itself.
125125

126126
#### Dependencies
127127

@@ -217,7 +217,7 @@ In production on your own site, you'll need to change this to:
217217

218218
`EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'`
219219

220-
and configure [SMTP settings](https://docs.djangoproject.com/en/3.2/topics/email/#smtp-backend) appropriate for your email provider.
220+
and configure [SMTP settings](https://docs.djangoproject.com/en/stable/topics/email/#smtp-backend) appropriate for your email provider.
221221

222222
### Testing Content-Security-Policy compliance in Wagtail
223223

@@ -229,24 +229,12 @@ By default, `django-csp` is not enabled since Wagtail isn't fully compatible yet
229229

230230
The `main` branch of this demo is designed to work with both the latest stable release and the latest `main` branch (development version) of Wagtail. To run the demo against a specific version of Wagtail, we have created [git tags](https://github.com/wagtail/bakerydemo/tags) for the latest commits that work with each feature release.
231231

232+
- [`v6.3`](https://github.com/wagtail/bakerydemo/releases/tag/v6.3)
232233
- [`v6.2`](https://github.com/wagtail/bakerydemo/releases/tag/v6.2)
233234
- [`v6.1`](https://github.com/wagtail/bakerydemo/releases/tag/v6.1)
234235
- [`v6.0`](https://github.com/wagtail/bakerydemo/releases/tag/v6.0)
235-
- [`v5.2`](https://github.com/wagtail/bakerydemo/releases/tag/v5.2)
236236

237-
<details>
238-
239-
<summary>Older tags</summary>
240-
241-
- [`v5.1`](https://github.com/wagtail/bakerydemo/releases/tag/v5.1)
242-
- [`v5.0`](https://github.com/wagtail/bakerydemo/releases/tag/v5.0)
243-
- [`v4.2`](https://github.com/wagtail/bakerydemo/releases/tag/v4.2)
244-
- [`v4.1`](https://github.com/wagtail/bakerydemo/releases/tag/v4.1)
245-
- [`v4.0`](https://github.com/wagtail/bakerydemo/releases/tag/v4.0)
246-
- [`v3.0`](https://github.com/wagtail/bakerydemo/releases/tag/v3.0)
247-
- [`v2.16`](https://github.com/wagtail/bakerydemo/releases/tag/v2.16)
248-
249-
</details>
237+
See the [complete tags list](https://github.com/wagtail/bakerydemo/tags) for older releases.
250238

251239
The tags point to the last commit just before the requirements were updated to the next Wagtail version. For example, the `v4.2` tag points to the commit just before the bakerydemo was updated to use Wagtail 5.0. This ensures that the tagged demo code contains the latest updates possible for the supported version.
252240

requirements/base.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Django==5.1.6
22
django-dotenv==1.4.2
3-
wagtail==6.4.0
43
wagtail-font-awesome-svg>=1,<2
54
django-debug-toolbar>=4.2,<5
65
django-extensions==3.2.3

requirements/production.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
-r base.txt
22
elasticsearch==5.5.3
33
# Additional dependencies for Heroku, AWS, and Google Cloud deployment
4-
uwsgi>=2.0.17,<2.1
5-
psycopg[binary]>=3.1,<3.2
4+
uwsgi==2.0.17
5+
psycopg[binary]==3.1.0
66
whitenoise==6.6.0
7-
boto3==1.9.189
7+
boto3==1.37.0
88
google-cloud-storage==2.13.0
99
django-storages==1.14.2
1010
# For retrieving credentials and signing requests to Elasticsearch
11-
botocore>=1.12.33,<1.13
1211
aws-requests-auth==0.4.3
1312
django-redis==5.4.0
14-
django-basic-auth-ip-whitelist==0.6
13+
django-basic-auth-ip-whitelist==0.7.0

0 commit comments

Comments
 (0)