Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Tuesday, January 27, 2009

Django documentation search bookmarklet

Here is a simple bookmarklet to search the Django documentation. To use it, simply drag this bookmark - Search Django Docs- to your browser's toolbar.

Click on the bookmark, enter a search term and you will be taken to the Django documentation search page with search results for your search term.


Disclaimer / Terms of Use

Obviously, this is not an official Django Search bookmarklet. I had created it  for my own use and sharing it with you. The search bar bookmarklet is totally innocuous, but nevertheless by installing it you agree I am not liable for anything, period, the end.

Inspired by the Prototype API Search bookmarklet from http://prototypejs.org/api.


Source Code
p=prompt('Search Django Documentation');
if(p) {
  p=p.replace(/\./g, '/');
// Location is the search query appended to the Django custom search URL
loc='http://docs.djangoproject.com/en/dev/search/?cx=009763561546736975936:e88ek0eurf4&cof=FORID:11&ie=UTF-8&hl=&sa=Search&q='+p.toLowerCase();
window.open(loc); // Open in new window
};
return false; // Inform the browser that the action of opening a URL, should not evaluate

Wednesday, April 2, 2008

Tools for developing Dynamic Web Sites

I started developing web sites about an year ago. When I started out I did not know of any of the frameworks which make the job of developing a dynamic web site easy. I spent a lot of time finding tools which suited my need.

In this post I have listed the tools I use. It may help newbies by giving a reference point to start out their exploration.

LAMP Based

The base infrastructure is LAMP with a little deviation. I use Linux-Apache-MySQL-Python (instead of PHP).

For the uninitiated this means I run the Apache web server, with MySQL as my Database engine, on the Linux operating system. Python is used for generating dynamic web pages on the fly.

Framework for Dynamic pages

Django is used for generating dynamic web pages. Django lets you build high-performing, elegant Web applications quickly. Django focuses on automating as much as possible and adhering to the DRY principle. Django is very well documented and the online Django Book makes it very easy for anyone to start using Django quickly.

Frontend

I layout my pages using Blueprint. This is a CSS framework which allows you to have a great layout with very clean and simple code. List formatting is done with Listamatic. It provides a easy way to create great looking lists.

And of course there is AJAX. I use the excellent Prototype and Scriptaculous libraries to add Ajax to my site. These libraries make it easy to have cross browser compatible JavaScripts.

Conclusion

Using tools greatly reduces the work required to be done to develop a website. Choosing a framework/tool which suits you is the biggest task. Think carefully about what you want to achieve and what the tool provides. Use the one which matches your style and requirements.

Wednesday, January 9, 2008

Django book

The long awaited Django book has been released. The book is now available in stores and online at http://www.djangobook.com/en/1.0/.

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Django was designed to make common Web-development tasks fast and easy. More info about Django can be found here http://www.djangoproject.com/.

Some reasons why you would want to choose Django as your Web framework:

Constructive reasons to use Django instead of Rails

ten reasons why you should use Django

I have been using Django for over six months now and can say that it is really easy to use and can get things done very fast.

Tuesday, January 1, 2008

The Zen of Python

I liked this a lot. Programming philosophy that I believe in.

Taken from http://www.python.org/dev/peps/pep-0020/ Author: Tim Peters <tim at zope.com>

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Monday, October 30, 2006

Script to ping Technocrati

Getting your blog listed on technocrati may be a good way to increase traffic to ur site. I have written a Python script to ping technocrati with your blog details. Here is a link to the script. The script could be quite useful to automatically ping Technocrati for all your blogs using a cron job.

Python rocks :)

Sunday, October 29, 2006

Comparison of REST Vs XML-RPC

Some background of the protocols

Rest protocol uses the HTTP GET and HTTP PUT methods to communicate with an application server. For example an API for a typical application would look like


http://example.com/users/
http://example.com/users/{user} (one for each user)
http://example.com/findUserForm
http://example.com/locations/
http://example.com/locations/{location} (one for each location)
http://example.com/findLocationForm

The client typically a webbrowser needs to construct HTTP requests and parse XML or HTML responses.

XML-RPC uses XML protocol to make Remote procedure calls to execute functions defined on objects, over the network.

An RPC application might define operations such as the following:

getUser()
addUser()
removeUser()
updateUser()
getLocation()
addLocation()
removeLocation()
updateLocation()
listUsers()
listLocations()
findLocation()
findUser()

The client needs to construct an XML request and parse the XML response.

Comparison

REST is an HTTP based protocol. Whereas XML-RPC is XML based.
IMO, REST being an HTTP based protocol works best when the client is a browser. XML-RPC on the other hand is XML based. So no assumption is made about the client which is going to use the protocol.
When the client is a browser, more efforts need to be put in by the client to use XML-RPC than to use REST.

An advantage of REST over XML-RPC is that each object has its own URL and can easily be cached, copied, and bookmarked.

Advantage of XML-RPC is that it is client independant. Any sort of client be it a desktop application a mobile application, a mashup using information from your site can easily integrate with XML-RPC.

Overall I think REST has its advantages in the browser world. But as more and more applications are using the web as a platform and accessing it through a variety of methods other than web browsers XML-RPC has and edge over REST.

Conclusion

Web services should provide and XML based interface like XML-RPC. The could also provide a RESTful interface built on top of XML-RPC to support browser based clients.

Web service implementation

Thursday, March 9, 2006

What is Grid Computing?

Have been reading a lot about "Grid Computing". Many times it seems to be used just as a buzzword to attract an audience.

From the terminology it seemd to be some sort of arrangement of computers connected to each other as a Grid. These computers interacted with each other over fast communication channels and together provided a better computing environment than a stanalone computer. This understanding is quite wrong.

The Grid in Grid computing has nothing to do with the connection architecture. Grid refers more to a "Power Grid". A power grid is a system which allows some entities to generate electric power and feed it to the Grid, while consumers can get their power supply from the Grid. The consumer does not care who generates the power and the Generators do not care who exactly consumes it. The middle-men, the distribution companies, take the onus of assuring Quality Of Service and billing consumers and paying the generators.

The concept of Grid Computing is somewhat similiar. There would be entities which can provide services like Computing capacity, Storage capacity, etc normally required for computing purposes. These services would be put on the Grid and consumers would consume them as required. The provider nor the consumers need to be aware of each other's identity. The only thing to care about is the Quality of Service a provider provides and the money a comsumer is ready to pay for it. Also a consumer would be billed only for the actual usage of the service.

The important aspects of Grid Computing are ability to locate services with specified attributes, having a QOS agreement and metering the usage of the service.

Implementing Grid Computing in an organization helps to keep track of usage of IT resources by different sections of the organization. This helps in charging various sections according to their usage of IT resources and seeing these charges as an cash inflow for the IT department. The budget spending in IT departments can be controlled with this information in hand.

Given the rise in availablity of internet connectivity it is very easy even for individual users to buy services off the grid and producers to put up their services on it. The rise in internet usage and bandwidth should be a good push for Grid Computing.