Build Geos and Collectstatic

was originally using these buildpacks:

https://github.com/GramercyStudios/heroku-geo-buildpack.git#1.1

https://github.com/heroku/heroku-buildpack-python.git#v40

got this error when i pushed: Collectstatic configuration error. To debug, run …..

when i ran: heroku run …. collectstatic everything was fine!!!

so i had to patch the python buildpack: https://github.com/mattharley/heroku-buildpack-python/commit/807ac1344b01daa8ccc5da0774adeb55fae3b6f5

then i got when i pushed:

—–> Preparing static assets Traceback (most recent call last):

….

django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND “geos”.

so i found a newer fork of heroku-geo-buildpack which had two newer commit to fix everything:https://github.com/Tekco/heroku-geo-buildpack/commits/master

Thanks

To this stack overflow post Heroku/Django: Could not import user-defined GEOMETRY_BACKEND “geos”

Django + Elastic Beanstalk

Hpflsk has been playing around with Django and AWS Elastic Beanstalk. We’ve hit a few roadblocks along the way, but so far we’re up and running and everything seems to be fine.

Just to summarise our current situation:

  • We have 1 Android and 3 iOs developers working hard on version 2 of the app
  • These guys and me (sometimes) are the only people hitting the new API
  • The new version of the app will be hitting the new AWS Elastic Beanstalk setup

Here are a few roadblocks  and successes we hit along the way:

  • Setup using this excellent guide from Grigory Kruglov but each of the .config files, change commands: from commands: to container_commands:. This cost be a few frustrating and headbangingly awful days
  • The official docs get you started with a simple example, but in my opinion are really lacking
  • The whole config system is wack. The options are spread across two seperate files and one of them seems to update from AWS at random times. Uhh, it sucks and leads to so many headaches.

One thing I wanted to talk about was cost. There’s a guide that is on the Amazon site which estimates costs at something ridiculous – in the $1000s of dollars – and way outside the range of a lean startup. You definitely want to monitor your expenses using a Cloudwatch alarm.

So far, Hpflsk has been charged around $50 AUD a month with only a grand total of 5 people hitting the API regularly. This includes the free tier. This may seem like not that much, but it definitely discourages developers from creating a bunch of apps and seeing what sticks – which seems to be the lean startup model. So if you want to keep everything super lean and mean, you’re better off with a VPS (~$100 AUD per year). It’s that not much of a pain in the ass to setup – took me around a day – and can be used to host multiple projects.