I am trying to setup Geodjango 1.8 in a virtualenv with Python 2.7.9 (Win32).
I have installed and setup Postgres/PostGis and have my Path setup to my OSGeo4W directory. I have also installed the required Python bindings.
When I try to 'runserver' (to start the development server), I get the follow error:
... from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi File "C:\Users\Matt\Envs\django_venv\lib\site-packages\django\contrib\gis\gdal \prototypes\raster.py", line 24, in register_all = void_output(lgdal.GDALAllRegister, []) File "C:\Python27\Lib\ctypes\__init__.py", line 378, in __getattr__ func = self.__getitem__(name) File "C:\Python27\Lib\ctypes\__init__.py", line 383, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'GDALAllRegister' not foundI am able to start the development server in an app that doesn't use 'django.contrib.gis'.
My Settings.py:
DEBUG = TrueALLOWED_HOSTS = []# Application definitionINSTALLED_APPS = ('django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','django.contrib.gis','leaflet_map','djgeojson',)MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware',)ROOT_URLCONF = 'webmaps.urls'TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, },]WSGI_APPLICATION = 'webmaps.wsgi.application'# Database# https://docs.djangoproject.com/en/1.8/ref/settings/#databasesDATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'db', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', }}# Internationalization# https://docs.djangoproject.com/en/1.8/topics/i18n/LANGUAGE_CODE = 'en-us'TIME_ZONE = 'UTC'USE_I18N = TrueUSE_L10N = TrueUSE_TZ = True# Static files (CSS, JavaScript, Images)# https://docs.djangoproject.com/en/1.8/howto/static-files/STATIC_URL = '/static/'
أكثر...
I have installed and setup Postgres/PostGis and have my Path setup to my OSGeo4W directory. I have also installed the required Python bindings.
When I try to 'runserver' (to start the development server), I get the follow error:
... from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi File "C:\Users\Matt\Envs\django_venv\lib\site-packages\django\contrib\gis\gdal \prototypes\raster.py", line 24, in register_all = void_output(lgdal.GDALAllRegister, []) File "C:\Python27\Lib\ctypes\__init__.py", line 378, in __getattr__ func = self.__getitem__(name) File "C:\Python27\Lib\ctypes\__init__.py", line 383, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'GDALAllRegister' not foundI am able to start the development server in an app that doesn't use 'django.contrib.gis'.
My Settings.py:
DEBUG = TrueALLOWED_HOSTS = []# Application definitionINSTALLED_APPS = ('django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','django.contrib.gis','leaflet_map','djgeojson',)MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware',)ROOT_URLCONF = 'webmaps.urls'TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, },]WSGI_APPLICATION = 'webmaps.wsgi.application'# Database# https://docs.djangoproject.com/en/1.8/ref/settings/#databasesDATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'db', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', }}# Internationalization# https://docs.djangoproject.com/en/1.8/topics/i18n/LANGUAGE_CODE = 'en-us'TIME_ZONE = 'UTC'USE_I18N = TrueUSE_L10N = TrueUSE_TZ = True# Static files (CSS, JavaScript, Images)# https://docs.djangoproject.com/en/1.8/howto/static-files/STATIC_URL = '/static/'
أكثر...