Wednesday, November 5, 2014

nginx, postgresql, django, virtualenv

Nice tutorial here on Digital Ocean:
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn

The instructions fell apart a bit once I got to the section configuring postgres.  Basically, when I expected to see a query about a role name it skipped that and started asking me about a password.

So for the configuration of postgres on Ubuntu, I recommend skipping over to https://help.ubuntu.com/community/PostgreSQL  .

After that I went back to the guide.

I found that since I was using python3 and because of a bug in 'pip' where it wants to install things globally, I had to change the

'pip install psycopg2' inside my virtual environment to
'pip3 install psycopg2' to get a local installation with python3.

Next, there is a depracated command in the tutorial that no longer works.
Replace
gunicorn_django --bind yourdomainorip.com:8001
with
 gunicorn myapp.wsgi:application --bind yourdomainorip:8001

No comments:

Post a Comment