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:
Backup Journey to rsnapshot
When I started producing backup worthy files (code, documents, projects, etc …), I realised the importance of backups after losing important files which happens to everybody. So I started my journey with backup solutions.
Backup generation 1: My first backup was simple directory copy operation, I copied my important directories to external floppy (then CD), and since it is manual operation I always forget about it and my backups was always old.
Python auto complete in OSX
If you run Python shell in OSX you notice the auto completion functionality isn’t working, this is caused by Apple decision not to ship GNU readline and instead they use libedit (BSD license), to fix the problem I used the following snippet:
IPython Import Error
I tried to install IPython to play with it and learn more about scientific Python packages, but I faced an error on my first step:
Implementing Login/Logout in Django
Update: add names and namespace to URLs
Implementing user authentication is fairly easy job in Django, many functionalities are already included in the standard Django installation, you can manage users using the default “admin” app the comes with Django.
Here I will show how implement Login/Logout feature by relying on Django built-in views.