We love designing and developing websites, but what really drives us is solving problems and cultivating strong relationships with our clients
How to use pep8.py to write better Django code
By : shabda
Here is another or screencast I created for my "Getting Started with Django" series. Like this? Email us on what would you like to see.
(Watch in fullscreen.)
more info..Screencast: Django Tutorial Part 1
By : shabda
Django Screencast Tutorial 1 from Shabda Raaj on Vimeo.
I am creating screencasts for Django tutorial and other Django videos. Here is part 1. Liked this? Leave me a comment or email me and tell me what would you like me to create screencasts for.
(Watch the screencast in full screen mode.)
more info..How and why to use pyflakes to write better Python
By : shabda
Here is another of the screencasts I created for "Getting started with Python" series. Liked them? Let me know what else would you like me to create screencasts about?
more info..Getting started with South for Django DB migrations
By : akshar
South is a migration tool used with Django.There will be times when you would be adding fields to a model or changing the type of field (eg: Field was an IntegerField and you want to change it to FloatField). In such cases syncdb doesn't help and South comes to your rescue.
There were times when i tried "python manage.py migrate southapp", got some error and then tried "python manage.py migrate southapp 0001 --fake". In some cases, that worked. When it did not work, i tried something else and so on. There were confusions regarding what --fake ...
more info..A brief overview of Vagrant
By : dheeraj
Vagrant is a very good wrapper around Oracle's VirtualBox. It makes life easier for web developers and the like by providing a nice command-line interface to build, manage, provision, use virtual machines.
Why should you use Vagrant?
- You may want to install different versions of software without worrying about conflicts
- You don't want to remember which services to start/stop when you start working on a project
- The version of Operating system you use can be different from the one on the server. So, you want a way to emulate the behavior on server
- You want to develop ...
Writing jQuery plugins using Coffeescript
By : shabda
So you want to write a Jquery plugin. If you know jQuery and Coffeescript, this would be amazingly easy.
I will walk you through writing a jQuery plugin which will allow us to add alternating colors to alternating rows.
Here is the plugin in its entirety.
$ = jQuery
$.fn.zebraTable = (options) ->
defaults =
evenColor: '#ccc'
oddColor : '#eee'
options = $.extend(defaults, options)
@each ->
$("tr:even", this).css('background-color', options.evenColor)
$("tr:odd" , this).css('background-color', options.oddColor)
Lets look at what we did.
- We bound $ to jQuery object.
- We created an anonymous functions and added this to jQuery, by assigning it to
$.fn ...
Behind the Scenes: Request to Response
By : thejaswi
In the previous installment of "Behind the Scenes", we saw how the control flows from Form to File Storage. Today, we are going to see how the application reacts from request to response.
In this post, we are going to assume that we are using django's inbuilt runserver. The flow doesn't change much for other WSGI servers available.
When you invoke the runserver management command, the command line options are validated and an instance of WSGIServer is created and passed the WSGIRequestHandler, which is used to create the request object (WSGIRequest). After the request object is created and ...
more info..Using SQLite Database with Android
By : balu - Where there's a will, there's a way.
Android embeds an Open Source Database called SQLite, which supports standard relational database features like SQL syntax, transactions and prepared statements. In addition it requires only little memory at runtime (approx. 250 KB). In this post I would like to show how to work with a simple pragmatic example : Baby Names App.
Before writing the code, let me show you some of the screen-shots of Baby Names App, which requires interaction with the database.
-
When ever you launch the App, it will shows a Menu of items as below.

-
When we click on the highlighted button - "Common Names", it will ...
Haml for Django developers
By : shabda
Haml is taking the Ruby(and Rails) world by storm. Its not used as heavily by Python(and Django) developers as the Python solutions aren't as mature. I finally gave Haml a try and was pleasantly surprised how easy it was.
The most mature Python implementation of Haml is hamlpy, which converts the hamlpy code to Django templates. Others are shpaml and GHRML
Lets look at some templates from Django tutorial
{% if latest_poll_list %}
<ul>
{% for poll in latest_poll_list %}
<li><a href="/polls/{{ poll.id }}/">{{ poll.question }}</a></li>
{% endfor %}
</ul>
{% endif %}
Here is this template converted to Haml
-if ...Coffeescript for Python programmers
By : shabda
I just learnt Coffeescript, and as a Python programmer loved being able to write Javascript in a Python like language. Coffeescript is inspired by Python/Ruby and is very close to these languages. Writing Coffeescript and reading the compiled Javascript also improved my understanding of Javascript. Without much ado here is translation of some Python code to Coffeescript to get you started.
Defining a variable
Python
a = 10
Coffeescript
a = 10
Setting scope is done via whitespaces.
Python
if i == 10:
foo()
Coffeescript
if i == 10
foo()
No semicolons
List comprehensions
Python
languages = ["Python", "Coffeescript", "Java", "Ruby", "Haskell"]
languages = [lan ...How to use jsTree
By : akshar
Using jsTree
Problem Statement : To show a TreeView (hierarchical view of information) structure in a Web page.
I came across this problem when i was required to develop a web application which allows its users to store contacts and their related information(name, email, phone). The contacts would go into a folder and any folder can have any number of subfolders and any subfolder can have any number of contacts. Also, the folder structure can be nested as many levels deep as the user wants. So, how do you show the folder structure in a Web Page?
You might encounter ...
more info..Behind the Scenes: From HTML Form to Storage
By : thejaswi
In this post, we are going to see what happens behind the scenes when a file is uploaded to a django powered web application.

An HTML form with a file input (atleast one) and encoding set to multipart/form-data is submitted. The MultiPartParser parses the POST request and returns a tuple of the POST and FILES data (request.POST, request.FILES). The MultiPartParser processes the uploaded data using the File Upload Handlers objects (through the new_file, receive_data_chunk and upload_complete methods). The request.FILES values are a sequence of instances of UploadedFile.
In the django form, we pass the request.FILES ...
more info..Setting up your system to start with Django development on Ubuntu:
By : akshar
1>Being a Python web framework, Django requires Python. If you are on ubuntu, you probably have python installed on your system. If you don't have it installed, give the following command from the terminal:
sudo apt-get install python
This will install Python on your machine.
2>If you will be developing a database driven web application, you need to have a database setup on your system. I feel mysql is good and will tell you about installing mysql. It is pretty easy to install and use. You need to issue the following command from terminal:
sudo apt-get install ...Django: csrf error on non-existent urls
By : Javed
While testing out a API from another django site, I came across a seemingly common error.
403 Forbidden
CSRF verification failed. Request aborted.
Help
Reason given for failure:
No CSRF or session cookie.
Posting the data to the api endpoint returned 403 Forbidden with the standard csrf failure error page. I cross checked that the view was csrf_exempted and that CsrfViewMiddleware was not enabled. The view had some other unrelated decorators which I guessed could be the cause of the problem. According to this bug, not all decorators play nice with the csrf_exempt decorator. Even with that fixed, there was ...
Writing an e-mail application with Lamson - II
By : thejaswi
In the last post, we saw how to create the skeleton of a basic email application using Lamson. In this part, we'll see how to write a handler (in the controller) to open a ticket in Unfuddle, the project management tool we use at Agiliq.
If you look at the config/settings.py file, you'll see a handlers attribute that should be updated to match the file that contains the rules for mail routing. In this case, let us create a unfuddle.py under the app/handlers directory and update the config/settings.py:
handlers = ["app.handlers.unfuddle ...more info..
Writing an e-mail application with Lamson - I
By : thejaswi
Off late, we've been slightly busy with a 'lot' of new developments on our end and we've not been able to devote attention to the blog. In these busy periods, we tend to forget things faster. One such thing that Shabda recently pointed out that a couple of our applications (client and open source project) were raising exception. Because of the low frequency of these errors, they went unnoticed for quite a few days. We do check e-mail often but we are mostly drowned in our project management tool, Unfuddle. Shabda suggested we open a ticket for every ...
more info..Comparison of mobile app frameworks: Iphone, Java, Phonegap and Titanium
By : shabda
I recently built the same app with the common mobile technologies, Obj-C, Android:Java, Phonegap, and Titanium .
This is a quick comparison of the app frameworks.
Miscellaneous notes
- Phonegap and Titanium both amazed me. It feels very empowering to code in Html, css and JS, test it in Chrome, debug it with firebug, and deploy to a device without any changes. Titanium UI widgets are native, building it with JS was very cool.
- Phonegap and Titanium both underwhelmed me. I assumed Phonegap would have widgets which would be 95% of the way to looking like native widgets. It was easy ...
Getting started with Titanium development for Android and Iphone
By : shabda
This is the third post in our mobile app development series. ( You may want to read Phonegap and Android with Java.)
Like last time we will build an App which allows calculating the tax payable, per the rules here. We will use Titanium Mobile
Installing Titanium
Download and install the fairly small Titanium from their sites. Once you download and start it, it will download and install more components. You can then create a new project from their UI.
Layout the Layout
You can add UI widgets and lay them out using Javascript. You need to use Titanium's API ...
more info..Getting started with PhoneGap using Xcode for Mobile app development
By : shabda
This is next in the series of apps I am building using various mobile technologies. It is the same app as build using Java for Android for calculating the Tax payable (in India). You can get the code for Objective-C, Java-Android, and PhoneGap.
First the impressions
Phonegap was the easiest to work with among the Objective-C, Java and PhoneGap, by far. I created the app as easily as
Step 1. Write the app and test it in Browser using the Chrome developer tools. Step 2. Start a project in Xcode. Step 3. Copy the HTML and CSS files to project ...
more info..Starting Android app developement: From zero to app
By : shabda
We recently started with Mobile Application development. I am learning Android using the Commonsware book, and highly recommend it. This is a very short guide to getting you running your first Android app.
What will we build
We will build a simple tax calculator for India, per the rules given here for tax calculation. In this app, we need to gets users income and various tax deductible expenses. After that we need to update the UI to show the tax. You can see the final app and code on github here.
Setting up
- Install Java and Eclipse
- Install Android SDK ...
CSS3 Properties and Compatible Browsers
By : saikiran - Designholik
CSS3 is hot, Now you can create rounded borders, add shadow to boxes without images, embed fonts and many more things.
Here is the list of some CSS properties introduced in CSS3 and their browser support.
| Property | Browser Support | ||||
| IE9 | Firefox | Chrome | Safari | Opera | |
| border-radius | |||||
| box-shadow | |||||
| border-image | |||||
| text-shadow | |||||
| word-wrap | |||||
| @font-face | |||||
| background-size | |||||
| background-origin | |||||
| transform | |||||
| resize | |||||
| box-sizing | |||||
| outline-offset | |||||
| column-count | |||||
| column-gap | |||||
| column-rule | |||||
| @keyframes | |||||
| animation | |||||
| transition | |||||
iPhone and Android application development using Titanium
By : ashok
Titanium Mobile is Appcelerator's development platform for developing cross-platform native mobile applications. In this article we will be introducing you to installation and developing applications using Titanium.
Installation
Follow the steps mentioned here, to install Titanium and the corresponding sdks for your developement platform
Hello world application
Creating a new application and aplication structure is elaborately described in appcelerator gettting started guide
Creating Forms
Field Label
var win = Titanium.UI.currentWindow; // get refernce to the current window
var label = Titanium.UI.createLabel({
text: 'Label Name',
height: 50,
color: '#000000',
font:{fontSize:14},
top: 20, // vertical postion of label on ...Link roundup 10
By : thejaswi
- Troy Sobotka has a blog post on why GIMP is inadequate in the real world. Slightly worrying post.
- Kevin McCarthy has an article on "How 3 companies (Yammer, Proxlet and Bocoup) use Node.js"
- Pingdom has released a jaw-dropping article on "The Internet in 2010". A whopping 107 trillion emails were sent in the year!
- Mathias Meyer has an exhaustive item on the different levels of monitoring with examples of services and software.
- Yann Malet has written a neat post on how to write custom filters integrated into the django admin with a few lines of HTML.
- bebraw on reddit ...
Link roundup 9
By : thejaswi
Welcome to the first post of 2011!
- The Eldarion Team has launched "Gondor: An effortless production django hosting". Currently, it is in private beta and going by the homepage sounds very exciting.
- PK Shiu has graphically explained the workflow of South, the most preferred migration tool for django.
- Andy McKay has written an article on how to integrate bleach, an HTML whitelist and sanitizer with django. Rather than escaping the user's input completely (like innocuous formatting tags), it escapes only the risky tags like script tags.
- There is an interesting article on O'Reilly Answers on "5 Things You ...
- Deploying Django apps on Heroku
- How to use pep8.py to write better Django code
- Screencast: Django Tutorial Part 1
- How and why to use pyflakes to write better Python
- Getting started with South for Django DB migrations
- A brief overview of Vagrant
- Writing jQuery plugins using Coffeescript
- Behind the Scenes: Request to Response
- Using SQLite Database with Android
- Haml for Django developers
- rails
- django
- linkroundup
- django opinion
- opinion
- business
- API
- appengine
- python
- satire
- startup
- Uncategorized
- marketing
- personal
- rambling
- search
- interviews
- seo-interviews
- 5startupideas
- ideas
- seo
- tips
- forms
- paypal
- utilities
- datetime
- web2.0
- Amazon
- algorithms
- presentations
- products
- pinax
- satchmo
- ecommerce
- microsoft
- yahoo
- book
- tutorial
- models
- aggreagtion
- meta
- India
- apps
- about
- CSS
- Design
- wordpress
- test slug
- vim
- urls
- reviews
- javascript
- xmpp
- emacs
- Typography
- Grid Theory
- Color Theory
- iphone
- android
- titanium
- mobile applications
- CSS3
- Browser Compatibility
- mobile
- jobs
- lamson
- django setup
- files
- upload
- jsTree
- hierarchical view
- web page
- Treeview
- coffeescript
- request
- response
- South
- django south
- django migration
- --fake
- screencasts
- April 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
Deploying Django apps on Heroku
By : shabda
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.
-
-
- Confirm that you have all the required libraries and you can run your code locally using
-
-
more info..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.
manage.py runserver.Create a requirement.txt by using ::
Make sure you have a requirements.txt at the root ...