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_module
    fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "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_line
    utility.execute()
File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\management\__init__.py", line 330, in execute
self.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_argv
    self.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 execute
    self.check()
File "C:\Python27\lib\site-packages\django-1.8.4-py2.7.egg\django\core\management\base.py", line 481, in check
    include_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_checks
    new_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_models
    errors.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 check
    errors.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_fields
    errors.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 check
errors.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_checks
    return 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_field
    field_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_type
    return 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+unsubscr...@googlegroups.com <mailto:django-users+unsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto: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 <https://groups.google.com/d/msgid/django-users/3fa379ce-170f-48a3-911c-c8db168c6d53%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscr...@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/55F695ED.701%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to