Skip to content

Commit f82a094

Browse files
committed
Configure csrf trusted domains
1 parent 3b195f6 commit f82a094

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/temple_web/settings.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@
3131
# SECURITY WARNING: don't run with debug turned on in production!
3232
DEBUG = MyDjS.DEBUG
3333

34-
MY_LOCAL_IP = "192.168.1.12"
34+
3535

3636
ALLOWED_HOSTS = [
3737
"localhost",
3838
"127.0.0.1",
39-
".ngrok-free.app",
4039
"0.0.0.0",
4140
]
42-
if MyDjS.DEBUG:
43-
ALLOWED_HOSTS += [MY_LOCAL_IP]
41+
42+
4443
if MyDjS.MORE_ALLOWED_HOSTS:
4544
ALLOWED_HOSTS += MyDjS.MORE_ALLOWED_HOSTS
4645
# print(ALLOWED_HOSTS)
4746
CSRF_TRUSTED_ORIGINS = [
4847
"http://localhost:8000",
49-
"https://*.ngrok-free.app/",
5048
]
49+
for item in MyDjS.MORE_ALLOWED_HOSTS:
50+
CSRF_TRUSTED_ORIGINS.append(f"https://{item}")
5151

5252
if MyDjS.PROD:
5353
ALLOWED_HOSTS.append(f".{MyDjS.PROD_DOMAIN}")

0 commit comments

Comments
 (0)