Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset_db breaks with PostGIS without a template_postgis #489

Closed
maiksprenger opened this issue Apr 8, 2014 · 3 comments · Fixed by #517
Closed

reset_db breaks with PostGIS without a template_postgis #489

maiksprenger opened this issue Apr 8, 2014 · 3 comments · Fixed by #517
Assignees

Comments

@maiksprenger
Copy link
Contributor

create_query += ' TEMPLATE = template_postgis'
assumes that a template database exists, and is called template_postgis. Both assumptions are bad, as the template database can be changed. With PostGIS 2.0 and PostgreSQL 9.1, a template database is not necessary anymore.

The correct fix is probably to use template_postgis from django.contrib.gis.db.backends.postgis.creation and only append the TEMPLATE to the SQL if it is not None. As it stands, I can't use reset_db with a modern PostGIS setup.

@camilonova
Copy link
Member

@maikhoepfel Can you make a pull request? Also I'm not sure how is going to deal with backwards compatibility.

@camilonova camilonova self-assigned this Apr 9, 2014
maiksprenger added a commit to django-oscar/django-oscar that referenced this issue Apr 10, 2014
This ensures that we catch errors in the build process of the demo site,
and led to me spotting #1294.

I must've accidentally committed my demo database settings; switched to
a more generic defaults in demo/settings.py. Also added ATOMIC_REQUESTS
as that is recommended by Oscar.

django-extensions' reset_db fails with PostGIS without a template
database, hence it is skipped on Travis.
django-extensions/django-extensions#489
maiksprenger added a commit to django-oscar/django-oscar that referenced this issue Apr 10, 2014
This ensures that we catch errors in the build process of the demo site,
and led to me spotting #1294.

I must've accidentally committed my demo database settings; switched to
a more generic defaults in demo/settings.py. Also added ATOMIC_REQUESTS
as that is recommended by Oscar.

django-extensions' reset_db fails with PostGIS without a template
database, hence it is skipped on Travis.
django-extensions/django-extensions#489
@camilonova
Copy link
Member

@maikhoepfel any updates?

@maiksprenger
Copy link
Contributor Author

@camilonova I unfortunately won't have time to work on this beyond filing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants