Skip to content

Commit 8c3ad51

Browse files
Add CORS support and update allowed hosts in settings (#126)
1 parent 228ed1d commit 8c3ad51

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

messWebsite/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
# SECURITY WARNING: don't run with debug turned on in production!
2121
DEBUG = env.bool("DEBUG", default=False)
2222

23-
ALLOWED_HOSTS = ["diningfee.iiti.ac.in", "127.0.0.1"]
23+
ALLOWED_HOSTS = ["diningfee.iiti.ac.in", "127.0.0.1", "localhost"]
2424
CSRF_TRUSTED_ORIGINS = ["http://diningfee.iiti.ac.in", "https://diningfee.iiti.ac.in"]
25+
CORS_ORIGIN_ALLOW_ALL = True # Will change this to false after some time
2526
# Application definition
2627

2728
INSTALLED_APPS = [
@@ -35,6 +36,7 @@
3536
"django.contrib.sites",
3637
"django.contrib.admindocs",
3738
# Third-party apps
39+
"corsheaders",
3840
"import_export",
3941
"django_admin_logs",
4042
"allauth",
@@ -53,6 +55,7 @@
5355
]
5456

5557
MIDDLEWARE = [
58+
'corsheaders.middleware.CorsMiddleware',
5659
"django.middleware.security.SecurityMiddleware",
5760
"django.contrib.sessions.middleware.SessionMiddleware",
5861
"django.middleware.common.CommonMiddleware",

0 commit comments

Comments
 (0)