Skip to content

Commit

Permalink
fix tls proxy and ga4
Browse files Browse the repository at this point in the history
  • Loading branch information
bbengfort committed Nov 23, 2022
1 parent dc94be3 commit 9cccd46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/components/analytics.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-154869920-1"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1D0HBVQHPW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-154869920-1');
gtag('config', 'G-1D0HBVQHPW');
</script>
5 changes: 5 additions & 0 deletions webfolio/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
## SSL is terminated at Traefik so all requests will be http in the k8s cluster.
SECURE_SSL_REDIRECT = False

## Ensure that the Traefik proxy causes Django to act like its behind TLS
SOCIAL_AUTH_REDIRECT_IS_HTTPS = True
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

## Static files served by WhiteNoise
STATIC_ROOT = os.path.join(PROJECT, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

0 comments on commit 9cccd46

Please sign in to comment.