From 6e807d07a2eb462f5086d348844be9e26f3a724a Mon Sep 17 00:00:00 2001 From: ronny abraham Date: Tue, 4 Jul 2023 03:16:08 +0300 Subject: [PATCH] updated the foundation readme, and the postgis readme to further explain another solution to the postgis testing error when we aren't superuser --- share/templates/readmes/foundation.md | 12 ++++++++++++ share/templates/readmes/postgis.md | 21 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/share/templates/readmes/foundation.md b/share/templates/readmes/foundation.md index a08e959..1d069c1 100644 --- a/share/templates/readmes/foundation.md +++ b/share/templates/readmes/foundation.md @@ -114,6 +114,18 @@ create a new template ## installing via foundation-sites npm install foundation-sites + +# Alternate way of loading Foundation + +install foundation-sites +link to foundation-sites parent directory + + ln -s /pathto/node_modules/foundation-sites /pathto/sass/foundation-sites + +inside the sass file import foundation as + + @import foundation-sites/scss + diff --git a/share/templates/readmes/postgis.md b/share/templates/readmes/postgis.md index 52151b2..0c506a9 100644 --- a/share/templates/readmes/postgis.md +++ b/share/templates/readmes/postgis.md @@ -14,4 +14,23 @@ use [docker-postgis](https://github.com/kartoza/docker-postgis) now the admin can run the tests -`sudo docker exec -it minyanfinder_development_db bash` \ No newline at end of file +`sudo docker exec -it minyanfinder_development_db bash` + +#### another more elegant solution to the problem + +[create extension without superuser role](https://stackoverflow.com/questions/16527806/cannot-create-extension-without-superuser-role) + +[potential problem if it's not working](https://stackoverflow.com/questions/39556719/django-test-error-creating-the-test-database-permission-denied-to-copy-databas) + +createdb template_postgis; # create a new database +psql -U postgres -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';" # make it a template psql -U postpsql -U postgres -d template_postgis -c "CREATE EXTENSION postgis;" # install postgis in it + +example: +createdb -h localhost -p 49032 -U admin template_postgis +psql -h localhost -p 49032 -U admin minyanfinder_dev -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';" +psql -h localhost -p 49032 -U admin -d template_gis -c "CREATE EXTENSION postgis;" + +in local settings file: + +DATABASES['default']['TEST'] = dict() +DATABASES['default']['TEST']['TEMPLATE'] = 'template_postgis'