【GeoDjango】OSGeo4Wが見つからないらしい。。。。。

Python

1""" 2Django settings for test1 project. 3 4Generated by 'django-admin startproject' using Django 4.2.9. 5 6For more information on this file, see 7https://docs.djangoproject.com/en/4.2/topics/settings/ 8 9For the full list of settings and their values, see 10https://docs.djangoproject.com/en/4.2/ref/settings/ 11"""12 13from pathlib import Path 14import os 15if os.name == 'nt':16 import platform 17 POSTGRES = r"C:\Program Files\PostgreSQL\11"18 OSGEO4W = r"C:\OSGeo4W"19 if '64' in platform.architecture()[0]:20 OSGEO4W += "64"21 22 assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W 23 24 os.environ['OSGEO4W_ROOT'] = OSGEO4W 25 os.environ['POSTGRES_ROOT'] = POSTGRES 26 os.environ['GDAL_LIBRARY_PATH'] = OSGEO4W + r"\bin"27 os.environ['GEOS_LIBRARY_PATH'] = OSGEO4W + r"\bin"28 os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal"29 os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj"30 os.environ['PATH'] = OSGEO4W + r"\bin;" + POSTGRES + r"\bin;" + os.environ['PATH']31 32# Build paths inside the project like this: BASE_DIR / 'subdir'.33BASE_DIR = Path(__file__).resolve().parent.parent 34 35 36# Quick-start development settings - unsuitable for production37# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/38 39# SECURITY WARNING: keep the secret key used in production secret!40SECRET_KEY = 'django-insecure-ei4m6vhrq1c+g7vymk59(*0zru+$-3#ac=%!80ony$oafu*b)7'41 42# SECURITY WARNING: don't run with debug turned on in production!43DEBUG = True44 45ALLOWED_HOSTS = []46 47 48# Application definition49 50INSTALLED_APPS = [51 'django.contrib.admin',52 'django.contrib.auth',53 'django.contrib.contenttypes',54 'django.contrib.sessions',55 'django.contrib.messages',56 'django.contrib.staticfiles',57 'django.contrib.gis', #gis158 'map.apps.MapConfig', #gis259]60 61MIDDLEWARE = [62 'django.middleware.security.SecurityMiddleware',63 'django.contrib.sessions.middleware.SessionMiddleware',64 'django.middleware.common.CommonMiddleware',65 'django.middleware.csrf.CsrfViewMiddleware',66 'django.contrib.auth.middleware.AuthenticationMiddleware',67 'django.contrib.messages.middleware.MessageMiddleware',68 'django.middleware.clickjacking.XFrameOptionsMiddleware',69]70 71ROOT_URLCONF = 'test1.urls'72 73TEMPLATES = [74 {75 'BACKEND': 'django.template.backends.django.DjangoTemplates',76 'DIRS': [],77 'APP_DIRS': True,78 'OPTIONS': {79 'context_processors': [80 'django.template.context_processors.debug',81 'django.template.context_processors.request',82 'django.contrib.auth.context_processors.auth',83 'django.contrib.messages.context_processors.messages',84 ],85 },86 },87]88 89WSGI_APPLICATION = 'test1.wsgi.application'90 91 92# Database93# https://docs.djangoproject.com/en/4.2/ref/settings/#databases94 95# Postgis用の接続設定96DATABASES = {97 'default': {98 'ENGINE': 'django.contrib.gis.db.backends.postgis',99 'NAME': 'geodjangodb',100 'USER': 'django_admin',101 'HOST':'localhost',102 'PASSWORD': 'django_admin',103 }104}105 106 107# Password validation108# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators109 110AUTH_PASSWORD_VALIDATORS = [111 {112 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',113 },114 {115 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',116 },117 {118 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',119 },120 {121 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',122 },123]124 125 126# Internationalization127# https://docs.djangoproject.com/en/4.2/topics/i18n/128 129LANGUAGE_CODE = 'ja'130 131TIME_ZONE = 'Asia-Tokyo'132 133USE_I18N = True134 135USE_TZ = True136 137 138# Static files (CSS, JavaScript, Images)139# https://docs.djangoproject.com/en/4.2/howto/static-files/140 141STATIC_URL = 'static/'142 143# Default primary key field type144# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field145 146DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'147

コメントを投稿

0 コメント