How Do You Get?

Snippet: Django in Cloud Run + Firebase Hosting

Some useful tips for running Django / Wagtail in Cloud Run and Firebase Hosting.

  1. This tutorial is a great resource: https://cloud.google.com/python/django/run
  2. Whitenoise gives a simple solution for static file serving from Django, and Firebase Hosting or CDN can provide caching.
  3. The following settings are needed:

# Cloudrun compatibility https://firebase.google.com/docs/hosting/manage-cache#using_cookies

# "Only the specially-named __session cookie is permitted to pass through to # the execution of your app."

SESSION_COOKIE_NAME = "__session"

# https://docs.djangoproject.com/en/5.1/ref/settings/#csrf-use-sessions

CSRF_USE_SESSIONS = True

Also: