|
| 1 | +from pathlib import Path |
| 2 | + |
| 3 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 4 | +BASE_DIR = Path(__file__).resolve().parent.parent |
| 5 | + |
| 6 | + |
| 7 | +# Quick-start development settings - unsuitable for production |
| 8 | +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ |
| 9 | + |
| 10 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 11 | +SECRET_KEY = "django-insecure-r^0hv0s#-%%jt!a7v1e7_#s+(@**(wn1n59iauee3e4t4e0&7r" |
| 12 | + |
| 13 | +# SECURITY WARNING: don't run with debug turned on in production! |
| 14 | +DEBUG = True |
| 15 | + |
| 16 | +ALLOWED_HOSTS = ["*"] |
| 17 | + |
| 18 | + |
| 19 | +# Application definition |
| 20 | + |
| 21 | +INSTALLED_APPS = [ |
| 22 | + "django.contrib.admin", |
| 23 | + "django.contrib.auth", |
| 24 | + "django.contrib.contenttypes", |
| 25 | + "django.contrib.sessions", |
| 26 | + "django.contrib.sites", |
| 27 | + "django.contrib.messages", |
| 28 | + "django.contrib.staticfiles", |
| 29 | + "dbtemplates", |
| 30 | + "example", |
| 31 | +] |
| 32 | + |
| 33 | +MIDDLEWARE = [ |
| 34 | + "django.middleware.security.SecurityMiddleware", |
| 35 | + "django.contrib.sessions.middleware.SessionMiddleware", |
| 36 | + "django.middleware.common.CommonMiddleware", |
| 37 | + "django.middleware.csrf.CsrfViewMiddleware", |
| 38 | + "django.contrib.auth.middleware.AuthenticationMiddleware", |
| 39 | + "django.contrib.messages.middleware.MessageMiddleware", |
| 40 | + "django.middleware.clickjacking.XFrameOptionsMiddleware", |
| 41 | +] |
| 42 | + |
| 43 | +ROOT_URLCONF = "example.urls" |
| 44 | + |
| 45 | +TEMPLATES = [ |
| 46 | + { |
| 47 | + "BACKEND": "django.template.backends.django.DjangoTemplates", |
| 48 | + "DIRS": [BASE_DIR / "example" / "templates"], |
| 49 | + "APP_DIRS": False, |
| 50 | + "OPTIONS": { |
| 51 | + "context_processors": [ |
| 52 | + "django.template.context_processors.debug", |
| 53 | + "django.template.context_processors.request", |
| 54 | + "django.contrib.auth.context_processors.auth", |
| 55 | + "django.contrib.messages.context_processors.messages", |
| 56 | + ], |
| 57 | + "loaders": [ |
| 58 | + "django.template.loaders.filesystem.Loader", |
| 59 | + "django.template.loaders.app_directories.Loader", |
| 60 | + "dbtemplates.loader.Loader", |
| 61 | + ], |
| 62 | + }, |
| 63 | + }, |
| 64 | +] |
| 65 | + |
| 66 | +WSGI_APPLICATION = "example.wsgi.application" |
| 67 | + |
| 68 | + |
| 69 | +# Database |
| 70 | +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases |
| 71 | + |
| 72 | +DATABASES = { |
| 73 | + "default": { |
| 74 | + "ENGINE": "django.db.backends.sqlite3", |
| 75 | + "NAME": BASE_DIR / "db.sqlite3", |
| 76 | + } |
| 77 | +} |
| 78 | + |
| 79 | +# Password validation |
| 80 | +# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators |
| 81 | + |
| 82 | +AUTH_PASSWORD_VALIDATORS = [] |
| 83 | + |
| 84 | + |
| 85 | +# Internationalization |
| 86 | +# https://docs.djangoproject.com/en/4.2/topics/i18n/ |
| 87 | + |
| 88 | +LANGUAGE_CODE = "en-us" |
| 89 | + |
| 90 | +TIME_ZONE = "UTC" |
| 91 | + |
| 92 | +USE_I18N = True |
| 93 | + |
| 94 | +USE_TZ = True |
| 95 | + |
| 96 | + |
| 97 | +# Static files (CSS, JavaScript, Images) |
| 98 | +# https://docs.djangoproject.com/en/4.2/howto/static-files/ |
| 99 | + |
| 100 | +STATIC_URL = "static/" |
| 101 | + |
| 102 | +# Default primary key field type |
| 103 | +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field |
| 104 | + |
| 105 | +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
| 106 | + |
| 107 | +SITE_ID = 1 |
| 108 | + |
| 109 | +DBTEMPLATES_USE_CODEMIRROR = True |
0 commit comments