Ubuntu new server checklist
These are the step I perform after installing new Ubuntu machine.
Django returning JSON for AJAX requests
In your views.py you can have a page that return JSON data for AJAX request like this:
Setting Up Python and Supervisor on CentOS
CentOS default repository is very limited, and even if you install EPEL you will get old packages, in my case I needed to install Supervisor to manage my Django application, after trying to do it manually and through EPEL I ended up with the following setup.
Django Multiple Settings with Single File
Instead of having multiple settings files one for production and one for development and so on, I prefer to use an “if” statement with environment variable:
Login to PostgreSQL without typing a Password
If you to connect to PostgreSQL without typing a password, you can do it by having your password in the file “.pgpass”.
Django “render” vs “render_to_response”
Summary: Always use render and not render_to_response
In Django you have more than one way to return a response, but many times I get confused between render and render_to_response, render_to_response seems shorter, so why not use it!
Install Python Image Library (PIL) on OSX
PIL or Python Imaging Library is a library that allows you to manipulate images in Python programming language, trying to install “PIL” using “pip” tool won’t work perfectly so here is how to proper installation.
My New Project: AgentX Implementation in Python
During this Eid vacation I spent many hours working on AgentX implementation in Python.
You can find the project in GitHub:
