These are chat archives for CharlesGust/django-imagr

22nd
Nov 2014
Ben Friedland
@BFriedland
Nov 22 2014 01:41
We got the server working on AWS, but we had to use Nginx and Gunicorn simultaneously.
The fabfile is still under construction.
Ben Friedland
@BFriedland
Nov 22 2014 03:20
Didn't get any real progress done since 6pm, unfortunately. "Fatal error: run() received nonzero return code -1 while executing!" while trying to have it pip install -r requirements.txt is the current holdup. Will have to look at it again tomorrow.
Charlie
@charlieRode
Nov 22 2014 03:23
I haven't made much progress today, really. Did you get the fabfile done?
Charles Gust
@CharlesGust
Nov 22 2014 06:11
Hi Charlie. We checked in what we had to the 'deployment1' branch. I think the fabfile was about 80% done, except none of the database setup was in there, and obviously you need more code to handle the S3/picture server stuff. Just to let you know, we had a cryptic error message (error502) that kept coming up running gunicorn. I had set up a CNAME of imagrapp.charlesgust.me but guess what? CNAME's can't have underscores. So, instead of deploying to a subdomain at charlesgust.me, we had to keep it at EC2<crazynumber>.amazonaws.com. Well, the security token that I thought was ONLY going to be used for POST also gives you 502 errors with GET. Who knew! We changed the token to '*", and were able to see imagr_app running on EC2 for the first time. It was a manual deployment; lots of typing at the SSH terminal, but it helped us develop the fabfile. Everything along the way was a gotcha. You have to run "update" and "upgrade" on your AMI (if you are using one from free tier that's crusty old like June 2014). You have to use something like nginx to proxy serve up the webpages (at least we couldnt get gunicorn to work by itself - but that was before we found the ALLOWED_HOSTS bug I just alluded to.). So, I think we are close, but I've felt we've been close for two days.
Charlie
@charlieRode
Nov 22 2014 06:33
God, what a mess. Okay, thanks Charles. Are you guys still at it?
Ben Friedland
@BFriedland
Nov 22 2014 23:16
I decided to read up a bit about gunicorn today. One of the things I found is that gunicorn's default configuration requires a proxy in front of it, which is why we seem to need Nginx.
It has something to do with reducing vulnerabilities, I think. There was an explanation about it in the gunicorn docs somewhere (I cloned it down and grepped a few things).