System check is using the default database connection for all the models

100 views
Skip to first unread message

Ion Scerbatiuc

unread,
Apr 24, 2015, 3:49:03 PM4/24/15
to django-d...@googlegroups.com
Hello,

Wasn't sure if this is a bug or not, and I couldn't find any related tickets on https://code.djangoproject.com

We have the following database set-up:
  • the default database is MySQL
  • two additional databases are PostGIS
The system check framework (either `manage.py check` or `manage.py runserver`) is using the default database (mysql) to validate `django.contrib.gis.db.models.Model`-based models, and the commands are blowing up with the following error: 
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'. 

You can find the detailed stack trace here: https://gist.github.com/delinhabit/587d6f26afb4bbc559cb

We set-up database routers for the PostGIS models to use the proper connection, but the check framework seems to ignore them. 
Are we doing something wrong? 
Is this a known pitfall of the system check framework around multiple databases that we are unaware of? 
Or is this a bug?

Thanks,
Ion

Tim Graham

unread,
Apr 25, 2015, 8:00:02 PM4/25/15
to django-d...@googlegroups.com
It seems like a bug to me. If I had to guess, I'd say it's a multi-database setup that no one thought to test when the system check framework was developed.

Ion Scerbatiuc

unread,
Apr 28, 2015, 10:40:44 AM4/28/15
to django-d...@googlegroups.com
I'll try to get a PR/proposal to fix the issue as soon as I get some free time this week. 

Should I also submit a bug here? https://code.djangoproject.com

Thanks,
Ion

Tim Graham

unread,
Apr 28, 2015, 11:11:07 AM4/28/15
to django-d...@googlegroups.com
Yes. Any non-trivial pull request should have a Trac ticket. See also our patch review checklist: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#patch-review-checklist.
Reply all
Reply to author
Forward
0 new messages