#22334 closed Bug (worksforme)
Postgis version check discards dev versions
Reported by: | xowap | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
After installing a dev version of Postgis, I noticed that my Django app started to throw django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "gmp". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?
Actually the version check regular expression did only accept regular version numbers (like 2.1.0) but not development version numbers (2.2.0dev).
Change History (8)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Component: | Uncategorized → GIS |
---|---|
Needs tests: | set |
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
This seems sensible to me, the only thing that is missing is a test for the newly supported behaviour. Could you add that to your PR?
comment:3 by , 11 years ago
Sure I will do.
I looked into it, however I could not find a proper place to put them. Would you have a recommendation to make on this subject?
comment:4 by , 11 years ago
Indeed. Feel free to create a new django/contrib/gis/tests/tests.py file.
comment:5 by , 11 years ago
Hum, this is embarrassing: while writing the tests, I discovered that I could not reproduce the bug on the unpatched code. Indeed, there is no $ at the end of the regexp.
I have no idea of how writing this patch turned the DB connection from "not working" to "working", but it wasn't probably correlated that much.
However, I wrote and pushed some unit tests, in case you want to keep them anyway.
Sent PR https://github.com/django/django/pull/2476