We are a small, intelligent App development studio. We love "Building Amazing Apps", solving problems and cultivating strong relationships with our clients.
Logging in Django
By : Javed Khan
This is a talk I gave at Agiliq on 21-March-2013 as a part of the Hyderabad Python Meetup Group
more info..Serving static files in Django
By : Akshar Raaj
Serving static files, especially during development, is frequently a pain point. In this post, we will discuss the various settings and directory structure and how they interact with each other. Let's start with development when you have DEBUG = True.
We will create a Django project from scratch so that we are fully aware about what file in what directory we are talking about. So, this blog post will be a little longer than it should be. We will try these things with Django 1.4, but these will work on Django 1.3 as well. I have not tested ...
more info..Two Scoops of Django: Review
By : Shabda Raaj

Two scoops of Django is the new book on Django best practices by Daniel Greenfeld and Audrey Roy. I just finished reading it and found it extremely useful.
The book is a collection of tips, their justification and code organized in logical areas. I have been using Django since 2008, but I still found a few tips which were new to me and many which served as good reminder. At about 200 pages, its comprehensive but not overwhelming. If you are an advanced Djangonaut, you can read it in a weekend (And you probably are using all its recommendations anyway ...
more info..Introduction to Python Workshop on February 15th, 2013
By : Thejaswi Puthraya
We are conducting an "Introduction to Python" workshop at our office on February 15th, 2013 (Friday) between 5-8PM IST. This workshop is geared towards those who are planning to learn python.
Topics:
- Language features
- Variables
- Built in data structures
- Functions
- Object Oriented Programming
- Demo writing a simple program
Prerequisites to attend this session:
- A laptop with any linux flavour (OR) a laptop with Python installed in it.
Register for the workshop by filling up the form.
more info..Easy client side form validations for Django: Django Parsley
By : Shabda Raaj
Parsleyjs is a JavaScript library to do client side data validations.
It does this in a non-intrusive way via adding a data-* attributes to form fields. Check it out, it's really slick.
Django forms do a great job of server side data validations. By integrating Parsley with Django form, you get good client side data validations as well. Get the app here.
Some design considerations
When I started writing this app I wanted to make it really easy to use. My first thought was to make this a filter or a template tag which would have allowed you to ...
more info..MoreApps - Android Library Project: Open Sourced
By : Shabda Raaj
If you have a portfolio of apps, you probably want to cross promote them.
We are open sourcing an Android Library Project to make this possible. Get the code. This provides an Activity which you can show with a Grid of your apps.
How to use it
Add this MoreAppsLibrary project(library) as a dependency in the Android Application project you are implementing.
Add the following code in your AndroidManifest.xml:
<activity android:name="com.agiliq.android.moreappslib.MoreAppsActivity"
android:label="More Apps">
</activity>
Perform an Intent to start the MoreAppsActivity; make sure to putExtra("package", getPackageName());, this ensures that ...
Tutorial: Building a Chrome app
By : bhaskar
This is a hands on tutorial about How to build chrome apps, with examples of two Chrome apps we published recently. Lets get started.
Chrome apps are of two types:
- Extensions : They extend the functionality of Google chrome and the websites. They have little or no UI. Ex:Password Generator . Source code : Github
- Apps: These are separate apps and appear just like any other website. Ex: To Do List. Source Code : Github
Depending on our requirement, we need to decide what kind of app we need to build.
Extension: Password Generator
Installation :
Visit the link Password Generator using google-chrome browser ...
more info..Password Generator App: Open Sourced
By : Shabda Raaj
Announcement:
We are open sourcing a few tools we developed recently. Here is the second one.
Password Generator Chrome Extension
Install it from chrome webstore
Here are the docs
Summary
A completely client side password generator.
What is it
Its a chrome app to generate unique passwords for each site. Depending upon the domain and a master password a unique password is generated. It doesn't need any server and everything happens on the client side.
Why?
I want to use a unique password for each website. However, I don't want to use lastpass/1password as I find their ...
more info..Todo List App: Open Sourced
By : Shabda Raaj
Announcement:
We are open sourcing a few tools we developed recently. Here is the first one.
This is a simple todo app - with the key feature that it is completely offline.
Features
- Create todo list
- Create todo
- Mark as done
- Delete
- Totally offline
Get the source or install the app.
more info..Android Fragments 101
By : ikram - Programmer, Web Hacker, App Developer, Techie & Geek.
Prerequisite: You are already aware of the basics of building a HelloWorld in Android and know how to use the APIs provided in the support library.
The code example is available on github.
Ever wanted a code snippet from an Activity to be available to other activities? Perhaps a Button or a ListView, maybe a Layout or any View/ViewGroup for that matter? Fragments let us do just that.
Necessity is the mother of invention.
Before understanding what Fragments are and how they work, we must first realize their existence in the first place.
The Problem
Suppose we have an ...
more info..Understanding decorators
By : Akshar Raaj
Understanding decorators in Python
We will divide this post into two topics
- Functions are objects and they can be passed around.
- Writing few decorators
As usual, I will be trying out the code in ipython and I suggest you to do the same.
Functions can be passed around similar to any other object in Python.
If you are already familiar with this, you can skip to next section.
Let's first write a class.
>>> class A(object):
... def __init__(self, a):
... self.a = a
...
Let's create an instance of this class.
>>> obj = A(5)
>>> print obj.a
5 #output ...Not exactly, not exactly tim the enchanter
By : Javed Khan
I've been putting off writing about my experience with django form wizard for some time now. I came across this blog post by Kenneth Love which finally compelled me to write this down.
About Django Form Wizard:
Form Wizard can be handy when you have a huge form, and you want to make it less intimidating to the user by splitting it into multiple steps.
If you have glued multiple forms together with sessions or whatnot and it
turned out to be a mess, you now what I'm talking about :)
Think surveys, checkouts, lengthy registrations etc.
The class ...
more info..The missing documentation for django.utils.datastructures
By : Thejaswi Puthraya
Note
django.utils.datastructures is intentionally not documented by the django core devs because it is an internal API and is liable to change without any notice. This file is not governed by django's lenient backwards-compatible policy. You have been sufficiently warned!
With the note out of the way, let's look at the interesting datastructures in this file. You may ask why we should learn about those when we shouldn't be using them? Reading code is the best way of learning and this file has some beautiful code.
MergeDict is the first of the datastructures in the ...
more info..Rails for Django developers
By : Shabda Raaj
My presentation at Pycon India 2012
Download it from here more info..
Dissecting Phonegap's architecture
By : Thejaswi Puthraya
Apache Cordova is a open source cross-platform framework for building native mobile applications using HTML, CSS and JavaScript. It started off as Phonegap, a project of Nitobi Software before it was acquired by Adobe Systems. The code for the platform was donated to the Apache Software foundation and is currently being incubated as "Apache Cordova".
Phonegap is now a distribution of Apache Cordova (analogous to Ubuntu being a Linux distribution) brought to you by Adobe. Since Apache Cordova is licensed under the permissive Apache Software License, Adobe Phonegap may technically be integrated with proprietary software (though there's no evidence ...
more info..Dropbox file upload handler for django
By : Thejaswi Puthraya
Dropbox announced new pro plans last week and some accounts have had their storage size doubled. Wouldn't it be wonderful if we could upload all our files to dropbox from our django webapp?
In this post, I write a custom file upload handler that will upload files from our application to dropbox.
Let us see how to use the custom file upload handler.
Install the Dropbox Python SDK before you setup your django app to handle the file uploads.
In your settings.py, add the following attributes (with the values filled):
DROPBOX_APP_KEY = "" DROPBOX_APP_SECRET_KEY = "" DROPBOX_APP_ACCESS_TOKEN = "" DROPBOX_APP_ACCESS_TOKEN_SECRET = "" # Optional values below # The ...more info..
Using Ubuntu cloud images in KVM
By : Thejaswi Puthraya
Quite a few of our clients are powered by Amazon EC2 or Rackspace and we use Ubuntu LTS releases for our servers. Canonical provides EC2 AMIs and Openstack images for all their releases. By using these JeOS images on the server as well as on the development platform reduces the dev/prod parity which we discussed in a previous post.
In this post, we'll see how to setup the Ubuntu cloud images in the local KVM hypervisor. Unlike the previous post, we'll use only the virt-manager to do the initial provisioning but you can be assured that there ...
more info..Metaclass in Python
By : Akshar Raaj
In this post we will be talking about Metaclass in python. If you are reading some code which uses metaclass, you will probably come across __new__. If you are not familiar with what __new__ does, i suggest you first read about __new__.
You can read about __new__ in our last to last post
Throughout this post we will be talking about new style classes. Things might differ in old-style classes.
As we go, i will be trying everything on IPython and suggest you as well to try everything on IPython.
Let's see a little bit about normal Objects in ...
more info..Libvirt and KVM
By : Thejaswi Puthraya
"But it works on my local setup!" We have heard or probably said this tens of times after something that we deployed to the production server breaks. After fire fighting for hours we learn that a particular package's version varies from the local setup. This is a fairly common problem that plagues every developer. Off late, quite a lot of interest and work is going into maximizing the dev/prod parity to prevent such problems.
Software like virtualenv help a great deal in compartmentalizing python dependencies but most web applications nowadays have to deal with loads of other dependencies ...
more info..__new__() in python
By : Akshar Raaj
Lately I started looking into Django code and wish to write about internals of Django. I started with Django models and will be writing about it soon. For understanding how Django models work, I had to understand what metaclasses are and how metaclasses work. Metaclasses use method "__new__" and so I looked at what "__new__" does.
As __new__ is a static method, we will see a lttle bit about static methods and then __new__ in detail.
-
Understanding static methods.
-
Understanding method "__new__" of any class. We will see how to override method __new__ in a class.
Also, I will be ...
more info..Understanding '*', '*args', '**' and '**kwargs'
By : Akshar Raaj
When i started learning Python, i was very confused regarding what args, kwargs, * and ** does. And i feel there are few like me who had this confusion and problem. With this post, i intend to reduce (hopefully i can eliminate) that confusion.
Throughout this post, i will be using ipython and i suggest you to try everything on ipython as well. We will intentionally make some mistakes along the way, so that we can understand this topic better.
Let's divide our work under five sections:
- Understanding what '*' does from inside a function call.
- Understanding what '*args' mean inside a ...
Provisioning Made Easy With Chef
By : Saket Bhushan
Managing Servers and scaling at will is hard. The bigger web players have put in years of effort, brute-forcing at times and re-iterating their methodologies, have come up with the secret sauce which they use to keep their cloud cool. The article is meant to be introductory rather than comprehensive. Chef has a steep learning curve, and in this post I wish to simplify few of the basic concepts. So, instead of going to the Chef Docs, finding searching, reading and re-reading, few of the beginner concepts are put at one place, which will help you get started on your ...
more info..Test Driven Development in Python
By : Anoop Thomas Mathew
We can either prevent bad things from happening or fix it, once it is detected.
It is your choice to select any of these methodology, while developing a software. You can either develop based on a test driven process or the recover from a fiasco with tests.
Test driven development, as the name suggests, is development based on tests. Tests for core features are written prior to the implementation for the expected output, and then necessary modules are written to satisfy the needs define the
Advantages of Test Driven Development
- application is determined by using it
- written minimal amount of ...
Deploying Django apps on Heroku
By : Shabda Raaj
Deploying Django apps on Heroku:
Read this first: http://devcenter.heroku.com/articles/django.
This is a great article by the Heroku. I am just filling in some more details and making this step-by-step.
- Get your Django project code.
-
Create a virtualenv with a no-site-packages command ::
virtualenv vent --no-site-packages
-
Install Django, psycopg2 (postgres connector), gunicorn and any other required Django libraries.
- Confirm that you have all the required libraries and you can run your code locally using
manage.py runserver. -
Create a requirement.txt by using ::
pip freeze > requirements.txt
-
Make sure you have a requirements.txt at the root ...
- Common testing scenarios for Django app.
- Logging in Django
- Serving static files in Django
- Two Scoops of Django: Review
- Introduction to Python Workshop on February 15th, 2013
- Easy client side form validations for Django: Django Parsley
- MoreApps - Android Library Project: Open Sourced
- Tutorial: Building a Chrome app
- Password Generator App: Open Sourced
- Todo List App: Open Sourced
- April 2013
- March 2013
- February 2013
- January 2013
- November 2012
- October 2012
- September 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- October 2011
- September 2011
- July 2011
- June 2011
- April 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- June 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- April 2009
- March 2009
- February 2009
- November 2008
- October 2008
- June 2008
- May 2008
- April 2008
Common testing scenarios for Django app.
By : Akshar Raaj
People are often confused regarding what tests to write. Let's look into some scenarios for which tests can be written.
Setting up the project
We start a Django project inside a virtual environment. In this post we would be using django 1.4.
Let's start an app named
blog.We will have the following model in
blog/models.py:We ...
more info..