Ramadhan2310 commited on
Commit
bcdfbcb
·
verified ·
1 Parent(s): a513b98

Update config/settings.py

Browse files
Files changed (1) hide show
  1. config/settings.py +8 -3
config/settings.py CHANGED
@@ -33,7 +33,7 @@ STATIC_ROOT = BASE_DIR / 'staticfiles'
33
  SECRET_KEY = os.getenv('SECRET_KEY', 'django-insecure-1+*4#52%(ibk-rwry0!q9(%7#il5@+ny1un48d!cp9fe5v=+ir')
34
 
35
  # SECURITY WARNING: don't run with debug turned on in production!
36
- DEBUG = os.getenv('DEBUG', 'True') == 'True'
37
 
38
  ALLOWED_HOSTS = ['*']
39
 
@@ -158,8 +158,13 @@ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
158
  # 1. Izinkan website tampil di dalam frame Hugging Face
159
  X_FRAME_OPTIONS = 'ALLOWALL'
160
 
161
- # 2. Tambahkan domain Hugging Face ke daftar terpercaya
162
  CSRF_TRUSTED_ORIGINS = [
 
163
  'https://*.hf.space',
164
  'https://huggingface.co'
165
- ]
 
 
 
 
 
33
  SECRET_KEY = os.getenv('SECRET_KEY', 'django-insecure-1+*4#52%(ibk-rwry0!q9(%7#il5@+ny1un48d!cp9fe5v=+ir')
34
 
35
  # SECURITY WARNING: don't run with debug turned on in production!
36
+ DEBUG = False
37
 
38
  ALLOWED_HOSTS = ['*']
39
 
 
158
  # 1. Izinkan website tampil di dalam frame Hugging Face
159
  X_FRAME_OPTIONS = 'ALLOWALL'
160
 
161
+ # Tambahkan domain spesifik space agar upload lancar
162
  CSRF_TRUSTED_ORIGINS = [
163
+ 'https://pcd2025-irkham.hf.space', # Link unik space kamu
164
  'https://*.hf.space',
165
  'https://huggingface.co'
166
+ ]
167
+
168
+ # Tambahkan baris ini agar Cookie keamanan bisa dikirim lewat iframe Hugging Face
169
+ CSRF_COOKIE_SAMESITE = 'None'
170
+ CSRF_COOKIE_SECURE = True