Spaces:
Sleeping
Sleeping
Final Fix: Configure ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
Browse files- FER_deploy/settings.py +11 -2
FER_deploy/settings.py
CHANGED
|
@@ -27,8 +27,17 @@ SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')
|
|
| 27 |
DEBUG = True
|
| 28 |
|
| 29 |
# Allows any host, which is safe in Hugging Face's containerized environment
|
| 30 |
-
ALLOWED_HOSTS
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
# Application definition
|
|
|
|
| 27 |
DEBUG = True
|
| 28 |
|
| 29 |
# Allows any host, which is safe in Hugging Face's containerized environment
|
| 30 |
+
# ALLOWED_HOSTS tells Django what domain names it is allowed to serve.
|
| 31 |
+
ALLOWED_HOSTS = [
|
| 32 |
+
'nomi78600-emotion-detector.hf.space',
|
| 33 |
+
'localhost',
|
| 34 |
+
'127.0.0.1',
|
| 35 |
+
]
|
| 36 |
+
|
| 37 |
+
# CSRF_TRUSTED_ORIGINS tells Django which websites are allowed to send POST requests (like file uploads).
|
| 38 |
+
CSRF_TRUSTED_ORIGINS = [
|
| 39 |
+
'https://nomi78600-emotion-detector.hf.space',
|
| 40 |
+
]
|
| 41 |
|
| 42 |
|
| 43 |
# Application definition
|