✨ add csrf env settion
This commit is contained in:
parent
1a2e88948a
commit
4a37e61265
|
|
@ -7,6 +7,7 @@ import markdown
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import shortuuid
|
import shortuuid
|
||||||
|
from django.conf.global_settings import CSRF_TRUSTED_ORIGINS
|
||||||
from django.core.validators import URLValidator
|
from django.core.validators import URLValidator
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render, get_object_or_404
|
||||||
|
|
@ -32,13 +33,15 @@ app = Django(
|
||||||
SECRET_KEY=DJANGO_SECRET_KEY,
|
SECRET_KEY=DJANGO_SECRET_KEY,
|
||||||
TIME_ZONE=os.getenv("TIME_ZONE", "Europe/Berlin"),
|
TIME_ZONE=os.getenv("TIME_ZONE", "Europe/Berlin"),
|
||||||
ALLOWED_HOSTS=["localhost"] + [host for host in
|
ALLOWED_HOSTS=["localhost"] + [host for host in
|
||||||
os.getenv("ALLOWED_HOSTS", "").split(",")],
|
os.getenv("DJANGO_ALLOWED_HOSTS", "").split(",")],
|
||||||
SQLITE_DATABASE=DATA_DIR / "db.sqlite3",
|
SQLITE_DATABASE=DATA_DIR / "db.sqlite3",
|
||||||
DEBUG=DEBUG,
|
DEBUG=DEBUG,
|
||||||
TEMPLATES_DIR=BASE_DIR / "templates",
|
TEMPLATES_DIR=BASE_DIR / "templates",
|
||||||
STATICFILES_DIRS=[
|
STATICFILES_DIRS=[
|
||||||
BASE_DIR / "static",
|
BASE_DIR / "static",
|
||||||
],
|
],
|
||||||
|
CSRF_TRUSTED_ORIGINS=[host for host in
|
||||||
|
os.getenv("DJANGO_ALLOWED_HOSTS", "").split(",")]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Import ninja after nanodjango has been initialised to avoid this error:
|
# Import ninja after nanodjango has been initialised to avoid this error:
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
1.0.2
|
1.0.3
|
||||||
Loading…
Reference in New Issue