|
| 1 | +""" |
| 2 | +Django settings for geodjango project. |
| 3 | +
|
| 4 | +Generated by 'django-admin startproject' using Django 6.0.2. |
| 5 | +
|
| 6 | +For more information on this file, see |
| 7 | +https://docs.djangoproject.com/en/6.0/topics/settings/ |
| 8 | +
|
| 9 | +For the full list of settings and their values, see |
| 10 | +https://docs.djangoproject.com/en/6.0/ref/settings/ |
| 11 | +""" |
| 12 | + |
| 13 | +from pathlib import Path |
| 14 | +import os |
| 15 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 16 | +BASE_DIR = Path(__file__).resolve().parent.parent |
| 17 | + |
| 18 | + |
| 19 | +# Quick-start development settings - unsuitable for production |
| 20 | +# See https://docs.djangoproject.com/en/6.0/howto/deployment/checklist/ |
| 21 | + |
| 22 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 23 | +SECRET_KEY = 'django-insecure-9kk224kjigo&fv=qgpuf_eyp6q%d-y8fl$$rw)i25pkzufb@ig' |
| 24 | + |
| 25 | +# SECURITY WARNING: don't run with debug turned on in production! |
| 26 | +DEBUG = True |
| 27 | + |
| 28 | +ALLOWED_HOSTS = [] |
| 29 | + |
| 30 | + |
| 31 | +# Application definition |
| 32 | + |
| 33 | +INSTALLED_APPS = [ |
| 34 | + 'django.contrib.admin', |
| 35 | + 'django.contrib.auth', |
| 36 | + 'django.contrib.contenttypes', |
| 37 | + 'django.contrib.sessions', |
| 38 | + 'django.contrib.messages', |
| 39 | + 'django.contrib.staticfiles', |
| 40 | + "django.contrib.gis", |
| 41 | + "world", |
| 42 | + "storages", |
| 43 | +] |
| 44 | +MINIO_ENDPOINT_URL = os.environ.get("MINIO_ENDPOINT_URL", "http://localhost:9000") |
| 45 | +MINIO_ACCESS_KEY = os.environ.get("MINIO_ROOT_USER", "minio_admin") |
| 46 | +MINIO_SECRET_KEY = os.environ.get("MINIO_ROOT_PASSWORD", "minio_password") |
| 47 | +MINIO_BUCKET = os.environ.get("MINIO_BUCKET_NAME", "kc3hack-bucket") |
| 48 | +MIDDLEWARE = [ |
| 49 | + 'django.middleware.security.SecurityMiddleware', |
| 50 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 51 | + 'django.middleware.common.CommonMiddleware', |
| 52 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 53 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 54 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 55 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 56 | +] |
| 57 | +STORAGES = { |
| 58 | + "default": { |
| 59 | + "BACKEND": "storages.backends.s3.S3Storage", |
| 60 | + "OPTIONS": { |
| 61 | + "access_key": MINIO_ACCESS_KEY, |
| 62 | + "secret_key": MINIO_SECRET_KEY, |
| 63 | + "bucket_name": MINIO_BUCKET, |
| 64 | + "endpoint_url": MINIO_ENDPOINT_URL, |
| 65 | + "region_name": "us-east-1", |
| 66 | + "use_ssl": False, |
| 67 | + "verify": False, |
| 68 | + "default_acl": None, |
| 69 | + }, |
| 70 | + }, |
| 71 | + #ここよくわからんstaticfilesはローカルに保存するための設定。本番環境だとどうなるか不明。 |
| 72 | + "staticfiles": { |
| 73 | + "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage", |
| 74 | + }, |
| 75 | +} |
| 76 | +ROOT_URLCONF = 'geodjango.urls' |
| 77 | + |
| 78 | +TEMPLATES = [ |
| 79 | + { |
| 80 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 81 | + 'DIRS': [], |
| 82 | + 'APP_DIRS': True, |
| 83 | + 'OPTIONS': { |
| 84 | + 'context_processors': [ |
| 85 | + 'django.template.context_processors.request', |
| 86 | + 'django.contrib.auth.context_processors.auth', |
| 87 | + 'django.contrib.messages.context_processors.messages', |
| 88 | + ], |
| 89 | + }, |
| 90 | + }, |
| 91 | +] |
| 92 | + |
| 93 | +WSGI_APPLICATION = 'geodjango.wsgi.application' |
| 94 | + |
| 95 | + |
| 96 | +# Database |
| 97 | +# https://docs.djangoproject.com/en/6.0/ref/settings/#databases |
| 98 | + |
| 99 | +DATABASES = { |
| 100 | + "default": { |
| 101 | + "ENGINE": "django.contrib.gis.db.backends.postgis", |
| 102 | + "NAME": "mapdb", |
| 103 | + "USER": "kc3hack_user", |
| 104 | + "PASSWORD": "kc3hack_password", |
| 105 | + "HOST": "localhost", |
| 106 | + "PORT": "5432", |
| 107 | + } |
| 108 | +} |
| 109 | + |
| 110 | +PATIALITE_LIBRARY_PATH = "/usr/lib/x86_64-linux-gnu/mod_spatialite.so" |
| 111 | +# Password validation |
| 112 | +# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators |
| 113 | + |
| 114 | +AUTH_PASSWORD_VALIDATORS = [ |
| 115 | + { |
| 116 | + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 117 | + }, |
| 118 | + { |
| 119 | + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 120 | + }, |
| 121 | + { |
| 122 | + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 123 | + }, |
| 124 | + { |
| 125 | + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 126 | + }, |
| 127 | +] |
| 128 | + |
| 129 | + |
| 130 | +# Internationalization |
| 131 | +# https://docs.djangoproject.com/en/6.0/topics/i18n/ |
| 132 | + |
| 133 | +LANGUAGE_CODE = 'en-us' |
| 134 | + |
| 135 | +TIME_ZONE = 'UTC' |
| 136 | + |
| 137 | +USE_I18N = True |
| 138 | + |
| 139 | +USE_TZ = True |
| 140 | + |
| 141 | + |
| 142 | +# Static files (CSS, JavaScript, Images) |
| 143 | +# https://docs.djangoproject.com/en/6.0/howto/static-files/ |
| 144 | + |
| 145 | +STATIC_URL = 'static/' |
0 commit comments