On 14.09.2015 11:58, Wenyao Xue wrote:
Hi,I use mysql as default database and postgres for geodjango related appliction.my settings:DATABASE_ROUTERS = ['world.routers.GisRouter','rest_shop.routers.ShopRouter','rest_client.routers.ClientRouter']
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql','NAME': 'fddd','USER': ******,'PASSWORD': ******,'HOST': SERVER_HOST,'PORT': '3306',},'geodjango': {'ENGINE': 'django.contrib.gis.db.backends.postgis','NAME': 'geo','USER': *****,'PASSWORD': *******,'HOST': SERVER_HOST,}}
during migration, error raised:
Traceback (most recent call last):File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.4\helpers\pycharm\django_manage.py", line 41, in <module>run_module(manage_file, None, '__main__', True)File "C:\Python27\lib\runpy.py", line 176, in run_modulefname, loader, pkg_name)File "C:\Python27\lib\runpy.py", line 82, in _run_module_codemod_name, mod_fname, mod_loader, pkg_name)File "C:\Python27\lib\runpy.py", line 72, in _run_codeexec code in run_globalsFile "D:\src\fddd_backend\manage.py", line 10, in <module>execute_from_command_line(sys.argv)File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\management\__init__.py", line 338, in execute_from_command_lineutility.execute()File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\management\__init__.py", line 330, in executeself.fetch_command(subcommand).run_from_argv(self.argv)File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\management\base.py", line 393, in run_from_argvself.execute(*args, **cmd_options)File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\management\base.py", line 443, in executeself.check()File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\management\base.py", line 481, in checkinclude_deployment_checks=include_deployment_checks,File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\checks\registry.py", line 72, in run_checksnew_errors = check(app_configs=app_configs)File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\checks\model_checks.py", line 28, in check_all_modelserrors.extend(model.check(**kwargs))File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\db\models\base.py", line 1205, in checkerrors.extend(cls._check_fields(**kwargs))File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\db\models\base.py", line 1282, in _check_fieldserrors.extend(field.check(**kwargs))File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\db\models\fields\__init__.py", line 207, in checkerrors.extend(self._check_backend_specific_checks(**kwargs))File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\db\models\fields\__init__.py", line 306, in _check_backend_specific_checksreturn connection.validation.check_field(self, **kwargs)
File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\db\backends\mysql\validation.py", line 18, in check_fieldfield_type = field.db_type(connection)File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\contrib\gis\db\models\fields.py", line 247, in db_typereturn connection.ops.geo_db_type(self)AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
Here it looks like Django is trying to validate something spatially related in you MySQL db and thus creating rather spurious error.
Do you have proper routing for migrations?
--
Is there something wrong with my settings?
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3fa379ce-170f-48a3-911c-c8db168c6d53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment