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

Deploy to Heroku fails #175

Open
stevenjan opened this issue Oct 18, 2016 · 7 comments
Open

Deploy to Heroku fails #175

stevenjan opened this issue Oct 18, 2016 · 7 comments

Comments

@stevenjan
Copy link

Hi all - totally new to all of this but I'm looking to build a shareabouts platform for bicycle consultation for a local shire and went the easy route by clicking the 'Deploy to Heroku' button after signing up and paying at Heroky. It all comes to a halt when deploying the app in the 'Build app' dialogue box - any help would be greatly appreciated!

-----> Preparing static assets

Collectstatic configuration error. To debug, run:

$ heroku run python ./src/manage.py collectstatic --noinput

-----> Running post-compile hook

-----> In post-compile hook

-----> Collecting static files

Traceback (most recent call last):

django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "d6g2cig4dkmrbt". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?

! Push rejected, failed to compile Multipack app.

! Push failed

@allthesignals
Copy link

Same. Any luck?

@stevenjan
Copy link
Author

stevenjan commented Oct 24, 2016

Glad Im not the only one but still no luck....

Just tried a moment ago and still getting the same error.... help please anyone?

@mjumbewu
Copy link
Member

Hey @allthesignals @stevenjan,

The issue here is that Shareabouts currently requires a geo-database (e.g., PostGIS). Heroku currently only supports postgis on production-teir databases. The deploy to heroku button tries to provision a free-tier database. I've started some work on allowing Shareabuts to use a spatial database only if it's installed (if anyone would like to help with that, please let me know!), but right now, in order to deploy on Heroku you'll need to:

  1. Updagrade the database, and
  2. Run CREATE EXTENSION postgis query on the database.

@allthesignals
Copy link

Thanks, @mjumbewu - do you know if it's possible to point the app to a remote spatially-enabled database? To solve this problem, we typically point Heroku apps to AWS-hosted database servers.

@mjumbewu
Copy link
Member

mjumbewu commented Oct 25, 2016

@allthesignals that's totally possible. In the Heroku settings (e.g., https://dashboard.heroku.com/apps/[yourappname]/settings) you would want to update the DATABASE_URL environment variable to point to the remote database (something of the form postgis://[username]:[password]@[hostname.rds.amazon.com]/[databasename]). Then, you'll have to run the database migrations from a command line (say, heroku run -a [yourappname] src/manage.py migrate). That should be sufficient.

(everything in square brackets above is just an example and would need to be replaced by appropriate values)

@allthesignals
Copy link

allthesignals commented Oct 25, 2016

Thanks, @mjumbewu - it worked. I had to follow the manual instructions here, but ignore the buildpacks part: https://github.com/openplans/shareabouts/blob/master/doc/DEPLOY.md#deploying-to-heroku-manually.

For others, the only buildpack I'm using is the one in the auto-deploy: https://github.com/ddollar/heroku-buildpack-multi.git. The instructions also call for installing rediscloud, so be sure to do that.

Thanks again!

@BenSturmfels
Copy link
Contributor

I don't use Heroku myself, but I suspect that since they no longer provide a free-of-charge tier, this is likely no longer an issue. From my brief reading of the current https://devcenter.heroku.com/articles/heroku-postgres-extensions-postgis-full-text-search#postgis page, it looks like this should work on lowest-tier "essentials" accounts. Even if not, this is more of an operational issue than an issue with Shareabouts.

@mjumbewu I think this is issue is probably safe to close.

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

No branches or pull requests

4 participants