Month: January 2015

Pointers working with Django, Uwsgi, Git

Hi,

I have been working with django, uwsgi, git for a month. I would like to share some common points which might help someone in saving their valuable time.

  1. While accessing api, don’t forget to add / at the end. Eg: 127.0.0.1/api/dummy will give you a 404 error. It has to be 127.0.0.1/api/dummy/
  2. When you update your code, to restart uwsgi, you need to use reload option. `uwsgi –reload /path-to-pidfile/master.pid`. Using `uwsgi –stop /path-to-pidfile/master.pid` and `uwsgi –ini /path-to-pidfile/master.pid` commands to restart would be a bad option as the child process have to be stopped completely and started again. You have to wait for the first command to finish completely before starting it.
  3. If you want to use “push to deploy” method for production, Kris Jordan’s blog will help a lot. Its pretty easy to setup. You might want to look at git documentation too.
  4. When in production, don’t forget to add necessary allowed hosts in settings. When working locally ensure your IP is present in allowed hosts.
Advertisements