Spaces:
Sleeping
Sleeping
Download myproject/settings.py from PeaceAbolisher/Model_Lab_Deployment: direct link, hf CLI and curl.
- Browser
- Download file 2.72 kB
-
https://huggingface.co/spaces/PeaceAbolisher/Model_Lab_Deployment/resolve/main/myproject/settings.py
- Command line
-
hf download hf://spaces/PeaceAbolisher/Model_Lab_Deployment/myproject/settings.py
-
curl -L -o settings.py https://huggingface.co/spaces/PeaceAbolisher/Model_Lab_Deployment/resolve/main/myproject/settings.py
2.72 kB
| from pathlib import Path | |
| BASE_DIR = Path(__file__).resolve().parent.parent | |
| LOGIN_URL = '/login/' | |
| LOGIN_REDIRECT_URL = '/landing/' | |
| SESSION_EXPIRE_AT_BROWSER_CLOSE = True | |
| SECRET_KEY = '...' | |
| DEBUG = True | |
| ALLOWED_HOSTS = ["*"] | |
| INSTALLED_APPS = [ | |
| 'django.contrib.admin', | |
| 'django.contrib.auth', | |
| 'django.contrib.contenttypes', | |
| 'django.contrib.sessions', | |
| 'django.contrib.messages', | |
| 'django.contrib.staticfiles', | |
| 'webapp.apps.WebappConfig', | |
| 'django_browser_reload', | |
| ] | |
| MIDDLEWARE = [ | |
| 'django.middleware.security.SecurityMiddleware', | |
| 'django.contrib.sessions.middleware.SessionMiddleware', | |
| 'django.middleware.common.CommonMiddleware', | |
| 'django.middleware.csrf.CsrfViewMiddleware', | |
| 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
| 'django.contrib.messages.middleware.MessageMiddleware', | |
| 'django_browser_reload.middleware.BrowserReloadMiddleware', | |
| ] | |
| CSRF_TRUSTED_ORIGINS = [ | |
| "https://peaceabolisher-ml-lab.hf.space", | |
| "https://huggingface.co", | |
| "https://*.huggingface.co", | |
| ] | |
| X_FRAME_OPTIONS = "ALLOWALL" | |
| ROOT_URLCONF = 'myproject.urls' | |
| TEMPLATES = [ | |
| { | |
| 'BACKEND': 'django.template.backends.django.DjangoTemplates', | |
| 'DIRS': [], | |
| 'APP_DIRS': True, | |
| 'OPTIONS': { | |
| 'context_processors': [ | |
| 'django.template.context_processors.request', | |
| 'django.contrib.auth.context_processors.auth', | |
| 'django.contrib.messages.context_processors.messages', | |
| ], | |
| }, | |
| }, | |
| ] | |
| WSGI_APPLICATION = 'myproject.wsgi.application' | |
| # Single DATABASES block | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.sqlite3', | |
| 'NAME': BASE_DIR / 'db.sqlite3', | |
| } | |
| } | |
| # NEW: DB-backed cache | |
| CACHES = { | |
| "default": { | |
| "BACKEND": "django.core.cache.backends.db.DatabaseCache", | |
| "LOCATION": "django_cache", # table name in db.sqlite3 | |
| } | |
| } | |
| MEDIA_ROOT = BASE_DIR / "media" | |
| MEDIA_URL = "/media/" | |
| AUTH_PASSWORD_VALIDATORS = [ | |
| {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'}, | |
| {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'}, | |
| {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'}, | |
| {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}, | |
| ] | |
| LANGUAGE_CODE = 'en-us' | |
| TIME_ZONE = 'UTC' | |
| USE_I18N = True | |
| USE_TZ = True | |
| STATIC_URL = 'static/' | |
| STATIC_ROOT = BASE_DIR / "staticfiles" | |
| DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' | |
| CSRF_COOKIE_SAMESITE = 'None' | |
| SESSION_COOKIE_SAMESITE = 'None' | |
| CSRF_COOKIE_SECURE = True | |
| SESSION_COOKIE_SECURE = True | |
| SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') | |