diff --git a/.gitpod.yml b/.gitpod.yml index d5966e1a..c14440d8 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -6,7 +6,7 @@ tasks: gulp migrate && gulp createcachetable env: - DJANGO_SETTINGS_MODULE: babybuddy.settings.development + DJANGO_SETTINGS_MODULE: babybuddy.settings.gitpod command: gulp ports: diff --git a/babybuddy/settings/.gitignore b/babybuddy/settings/.gitignore index 46b8a836..a4f1f2f0 100644 --- a/babybuddy/settings/.gitignore +++ b/babybuddy/settings/.gitignore @@ -3,6 +3,7 @@ !base.py !ci.py !development.py +!gitpod.py !heroku.py !production.example.py !test.py diff --git a/babybuddy/settings/gitpod.py b/babybuddy/settings/gitpod.py new file mode 100644 index 00000000..f5ca389e --- /dev/null +++ b/babybuddy/settings/gitpod.py @@ -0,0 +1,9 @@ +from .development import * + +# CSRF configuration +# https://docs.djangoproject.com/en/4.0/ref/settings/#std:setting-CSRF_TRUSTED_ORIGINS +# https://www.gitpod.io/docs/environment-variables/#default-environment-variables + +CSRF_TRUSTED_ORIGINS = [ + os.environ.get("GITPOD_WORKSPACE_URL").replace("https://", "https://8000-") +] \ No newline at end of file