From 1938bbbc694a28ddf8ba457857645e56bff27739 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Thu, 5 Feb 2026 11:12:49 -0500 Subject: [PATCH] Allow Cloudflare Pages branch previews to have API access via CORS --- terraform/django.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terraform/django.tf b/terraform/django.tf index 308573b5..a84902f2 100644 --- a/terraform/django.tf +++ b/terraform/django.tf @@ -21,6 +21,10 @@ module "django" { # Can't make this use "aws_route53_record.www.fqdn" because of a circular dependency "https://www.${data.aws_route53_zone.this.name}", ] + django_cors_allowed_origin_regexes = [ + # Can't base this on "cloudflare_pages_project.www.subdomain" because of a circular dependency + "https://[\\w-]+\\.bats-ai\\.pages\\.dev", + ] additional_django_vars = { DJANGO_SENTRY_DSN = "https://5bfdd2a77e7e8cbcea9ea873dbf9cbd6@o267860.ingest.us.sentry.io/4510800443015168" }