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..
Topics : python training

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..
Topics : django internals

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..

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..

Developing android applications from command line

By : Thejaswi Puthraya

Here at Agiliq, we also develop cross-platform HTML5 mobile applications. Using Eclipse to create an android project (one time task) and edit html and javascript files for an android app is an overkill. Wouldn't it be great, if you could use your favourite text editor to edit html and js files and then fall back to the terminal to deploy the android app? We are going to see exactly this in the post.

First, let's install the android SDK starter package(I assume that you have installed JDK and ant). Head over here and install the SDK for ...

more info..

Behind the Scenes: Request to Response

By : Thejaswi Puthraya

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..

Behind the Scenes: From HTML Form to Storage

By : Thejaswi Puthraya

In this post, we are going to see what happens behind the scenes when a file is uploaded to a django powered web application.

File Upload Flow

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..
Topics : django files upload
thejaswi
Comments
Reactions

Writing an e-mail application with Lamson - II

By : Thejaswi Puthraya

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..
Topics : lamson e-mail
thejaswi
Comments
Reactions

Writing an e-mail application with Lamson - I

By : Thejaswi Puthraya

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..
Topics : lamson e-mail
thejaswi
Comments
Reactions

Link roundup 10

By : Thejaswi Puthraya

  • 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 ...

more info..
Topics : linkroundup

Link roundup 9

By : Thejaswi Puthraya

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 ...

more info..
Topics : linkroundup

Link roundup 8

By : Thejaswi Puthraya

  • Django Dose community catchup episode #32 is out. Listen to it here.
  • Luke Plant has released a django app called django-anonymizer. It anonymizes sensitive data like customer information while maintaining the database structure intact.
  • Armin Ronacher who contends that web development is dangerous (and rightly so!) blogs about the common mistakes made by a web developer.
  • John Anderson has a very interesting post on "Tips and Tricks for the Python Interpreter". Must read!
  • Charles Leifer has written a generic app to provide for auto-completion of django models. Currently, it supports the solr, redis and sql database backends.
  • Kyle Neath has ...

more info..
Topics : linkroundup
thejaswi
Comments
Reactions

Django emacs setup

By : Thejaswi Puthraya

My colleague Javed had written a fantastic article a short while back on "Seven reasons why you should switch to Vim" and as an emacs user I thought I should share my setup too. One of the coolest things at Agiliq is that we are free to use the development tools of our choice. As a case to explain the point, everyone at agiliq uses a different editor and if someday a flame war would escalate to the third world war, I assure you it would start from Agiliq ;-)

Though I have been using emacs for more than two years ...

more info..
Topics : emacs

Link roundup for week ending 24/12/2010

By : Thejaswi Puthraya

It's been a while since we posted a link roundup. With holidays starting soon, we thought of advancing the post.

  • In the second part of the series the Open Source team at The Washington Times writes about "App-centric django development". Here they discuss the files required for a complete app.
  • Are you a full-stack programmer? Interesting article by Carlos Bueno of Facebook on the various interconnections in computing.
  • Daniel Greenfeld wrote a post on why he prefers stupid template languages. His post received reactions from Armin Ronacher, author of Jinja2, Mike Bayer of Mako and Steve Holden, chairman of ...

more info..
Topics : linkroundup

Link roundup for week ending 26/11/2010

By : Thejaswi Puthraya

  • In Washington Times' article on app-centric django development, they discuss the pros and cons of breaking your project into multiple apps.
  • Luke Plant writes how class based views in django views makes the code feel a bit like Ravioli (too many small classes with difficulty locating and identifying their functionality).
  • While we are at Ravioli, here is an interesting presentation about "How to stop writing Spaghetti code" in node.js.
  • Eric Holscher has a post on how to use Haystack search to index non-database content.
  • Facebook has written a blog post on "The underlying technology of Messages". Most of the ...

more info..
Topics : linkroundup
thejaswi
Comments
Reactions

Link Roundup for week ending 12/11/2010

By : Thejaswi Puthraya

  • jQuery 1.4.4 and jQuery mobile alpha 2 were released this week. Progress on the jQuery mobile development seems to be very brisk at the moment.
  • Eric Holscher wrote a series of posts on building a django app server with Chef.
  • Do you generally have a tough time deciphering captchas? TextCaptcha is a service that uses text based questions to separate the humans from machines. It's got an API too!
  • Django Dose community catchup Episode #30 is out. Check it out today.
  • All references to the project name from the imports in the django tutorial have been removed ...

more info..
Topics : linkroundup
thejaswi
Comments
Reactions

Link Roundup for week ending 5/11/2011

By : Thejaswi Puthraya

  • Jacob Kaplan-Moss has a beautiful article on concrete inheritance vs abstract models for inheritance. Must read!
  • Charles Leifer, the current maintainer of Django Snippets has an exhaustive blog post on setting up search using the Solr backend for Haystack.
  • Chris Heilmann has an interesting video on "Reasons to be Cheerful: being a web developer is awesome!"
  • Andy McKay defends the plain old non-reusable Django apps as they are easy to write, rapid to develop and have very little boilerplate code.
  • Piotr Malinski has a blog post on how to use web based image editors within django apps.
  • Derek Gathright shows ...

more info..
Topics : linkroundup
thejaswi
Comments
Reactions

Link Roundup for week ending 22/10/2010

By : Thejaswi Puthraya

more info..
Topics : linkroundup
thejaswi
Comments
Reactions

Link Roundup for week ending 15/10/2010

By : Thejaswi Puthraya

This is the first in a series of posts where we share links aggregated from popular sources, tools we use, projects we work on, almost everything related to web development and more....

  • Django's got HMAC signing: These set of changes prevent timing-based attacks and are fully backwards compatible unless you've a short SECRET_KEY.
  • Django's got more committers and they are already hard at work!
  • The django tests have been upgraded to use the unittest2 module. Phew! Lots of work has gone in the past couple of weeks. It just means one thing, the 1.3 alpha window ...

more info..
Topics : linkroundup
© Agiliq, 2009-2012