Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Django 5.0 + add FormSubmissionsPanel #473

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update all documentation URLs to point to stable Django
  • Loading branch information
thibaudcolas committed Jan 5, 2024
commit d29175863be319c212ee1675cb56a2d2642b9d10
2 changes: 1 addition & 1 deletion bakerydemo/base/templatetags/navigation_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from bakerydemo.base.models import FooterText

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


@register.simple_tag(takes_context=True)
Expand Down
14 changes: 7 additions & 7 deletions bakerydemo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
Generated by 'django-admin startproject' using Django 1.10.5.

For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
https://docs.djangoproject.com/en/stable/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
https://docs.djangoproject.com/en/stable/ref/settings/
"""

import os
Expand All @@ -19,7 +19,7 @@
BASE_DIR = os.path.dirname(PROJECT_DIR)

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

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


# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
# https://docs.djangoproject.com/en/stable/ref/settings/#databases

if "DATABASE_URL" in os.environ:
DATABASES = {"default": dj_database_url.config(conn_max_age=500)}
Expand All @@ -130,7 +130,7 @@


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

AUTH_PASSWORD_VALIDATORS = [
{
Expand All @@ -149,7 +149,7 @@


# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
# https://docs.djangoproject.com/en/stable/topics/i18n/

LANGUAGE_CODE = "en-us"

Expand All @@ -163,7 +163,7 @@


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

STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
Expand Down
8 changes: 4 additions & 4 deletions bakerydemo/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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

EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
Expand Down Expand Up @@ -186,7 +186,7 @@
# These settings are usually used only on the production sites.
# This is a configuration of the CDN/front-end cache that is used to cache the
# production websites.
# https://docs.wagtail.org/en/latest/reference/contrib/frontendcache.html
# https://docs.wagtail.org/en/stable/reference/contrib/frontendcache.html
# The backend can be configured to use an account-wide API key, or an API token with
# restricted access.
if (
Expand Down Expand Up @@ -271,7 +271,7 @@
# because the apps are running on client domains (or our own for staging), that are
# being used for other applications as well. We should therefore not impose any
# restrictions on these unrelated applications.
# https://docs.djangoproject.com/en/3.2/ref/settings/#secure-hsts-include-subdomains
# https://docs.djangoproject.com/en/stable/ref/settings/#secure-hsts-include-subdomains
SECURE_HSTS_INCLUDE_SUBDOMAINS = False

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

# Allow the redirect importer to work in load-balanced / cloud environments.
# https://docs.wagtail.io/en/v2.13/reference/settings.html#redirects
# https://docs.wagtail.org/en/stable/reference/settings.html#redirects
WAGTAIL_REDIRECTS_FILE_STORAGE = "cache"
2 changes: 1 addition & 1 deletion bakerydemo/templates/base/form_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1 class="index-header__title">{{ page.title }}</h1>
<div class="col-md-8 form-page">
{% comment %}
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:
https://docs.djangoproject.com/en/3.2/topics/forms/#form-rendering-options
https://docs.djangoproject.com/en/stable/topics/forms/#working-with-form-templates
{% endcomment %}
<form action="{% pageurl page %}" method="POST">
{% csrf_token %}
Expand Down
2 changes: 1 addition & 1 deletion bakerydemo/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/
"""

import os
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ docker compose logs -f

## Setup with Virtualenv

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/3.2/topics/install/#install-the-django-code) for Django itself.
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.

#### Dependencies

Expand Down Expand Up @@ -206,7 +206,7 @@ In production on your own site, you'll need to change this to:

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

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

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

Expand Down