I am new to geodjango. My database settings as following below,
DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis", # Add "postgresql_psycopg2", "postgresql", "mysql", "sqlite3" or "oracle".
"NAME": "testdb", # Or path to database file if using sqlite3.
"USER": "postgres", # Not used with sqlite3.
"PASSWORD": "test", # Not used with sqlite3.
"HOST": "localhost", # Set to empty string for localhost. Not used with sqlite3.
"PORT": "", # Set to empty string for default. Not used with sqlite3.
}
}
When I run the python manage.py syncdb. I got the below error,
Traceback (most recent call last):
File "manage.py", line 27, in <module>
execute_from_command_line()
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 217, in execute
translation.activate('en-us')
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 105, in activate
return _trans.activate(language)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 194, in activate
_active.value = translation(language)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 183, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 160, in _fetch
app = import_module(appname)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/nyros/hs/git_br/healersource/apps/messages_hs/__init__.py", line 2, in <module>
from django.db.models import signals
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/db/utils.py", line 93, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 11, in __init__
self.ops = PostGISOperations(self)
File "/home/nyros/hs/1a9pinaxenv/local/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/operations.py", line 108, in __init__
'template?' % self.connection.settings_dict['NAME']
django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "testdb". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?