Monday, May 30, 2011

Django models

Database are the backbone of any website, and database interactivity is a very important aspect of any server side programming.

As you all might be knowing that there are multiple vendors offering different databases. And usually in other established web development frameworks database queries are so tightly integrated with the code that any change in the backend database results in necessary changes in the code.

But not in django, Models are there for that service.

Models take care of the sql part for you and make it possible for the developer to concentrate on developing in a uniform language ( python ). Any change in the database can be handled by just making changes in settings.py file.

That's what i call intelligent development.

Regards,
Ishan

Saturday, May 28, 2011

django template loading

Templates are a really a great feature, using it is a delight as it lets the python developer concentrate on the backend code letting the designers concentrate on the page design.

If you are developing on a local dev machine and uploading it to a live server, template path can be an issue of concern for you.

To make it path independent there is a thing you can do to bypass that issue.
In the settings file, look for TEMPLATE_DIRS here you can use the python magic variable to chalk out a relative path.

import os.path
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates').replace('\\', '/'),
)

__file__ variable points to the current path and the templates directory can be joined on to the path.
In practical scenario __file__ will contain the src folder, so keep the templates folder inside the src folder.

Isn't it neat.

Regards,
Ishan

Saturday, May 21, 2011

ubuntu 11.04

I recently updated my netbook with ubuntu 11.04 which by default comes with the unity interface in place of vanilla gnome, i was previously using ubuntu netbook remix, which was the ubuntu version with unity.

The changes which i feel in terms of performance is the the speed and responsiveness of the whole interface has significantly improved.

Also the new file explorer is a pleasure to work with when compared with the one bundled in the last version.

The experience is smooth even with running apache,eclipse and multiple other programs on a hugely underpowered netbook, but that's a thing that expected of linux, isn't it.

things i liked about django

Django is turning out to be better than i imagined, its python whats not to like :).

But apart from that , the template system django implement to separate presentation from actual backend code is a beauty in itself.

URLconf is another feature of django which i enjoy, unlike other web development platforms where url's are where you store the page on the web directory.

As my affair with django continues i keep falling deeper and deeper.

Wednesday, May 18, 2011

Django development

Setting up a development is as important as starting with the development itself, Django development can be made easier with setting it up to be used with eclipse and pydev.

Pydev already comes with an option for creation of django projects, all that needs to be done is , download django from site and install it.

The step for installing and checking are :
1. unzip the downloaded file.
2. python setup.py install

To test if django has been setup correctly , just try this from console/command line

open python interactive shell, then type the following commands

1. import django
2. print django.get_version()

If you get some output about the installed django version you are good to go.

Now with both django and eclipse+pydev installed only 1thing remains to be done, configuring eclipse to use the recently installed django.

To achieve this ,from the eclipse menu go to.

windows->preference->pydev->interpreter-python
In the library tab click on the new button and point to the installed django root folder.

This will get you started.

Regards,
Ishan

Tuesday, May 17, 2011

Django hosting

Python as a language has fascinated me since my college days, python is as natural in flow and construct as it can get.

So, when i decide it was the time to patch together a web presence for myself , i started looking around for a web framework, But my specifications were rigid.

I needed a framework , which was opensource, so that rules out windows based development techs,
Also i don't have a liking for Java as a development environment. On digging a bit deeper i came across the web frameworks for Python.

There are many options when it comes web programming in Python for example "Zope", "Turbo gears" , "Django" and many more.

But Django just clicked with me.

Then came the real problem which i faced , which is the actual topic of this post, most of the hosting services don't provide shell account and also there is no scope for mod_cgi or fastcgi which is required to run Django apps.

But, there is no need to panic, there are some quality services which provide the required architecture to host Django apps.

Here is link from django site itself listing the popular hosting services, i myself have chosen "webfaction"

Friday, May 6, 2011

crossplatform mobile development

Hi,

The mobile development scene is too diverse, there are so many platforms to support, so many development environments to master.

Before the coming of android , the symbian development was a real pain in the ass.
There was no backward compatibility, the api's were so confusing that it finally lead to nokia's downfall.

Then came Android and iphone, there was some sort of order from then on, but it still restricted a developer to stick on a single platform. That places more control in the hands of already authoritarian market leaders.

But there is hope still, For those wishing to develop for multiple programs without investing in multiple technologies there is MoSync.

For those not aware of this wonderful tool, MoSync enables the developers to use there desktop development skill and start developing for mobile devices with minimal effort and that too without having to restrict themselves to a particular platform. MoSync is what a perfect development tools should be, in opensource, its platform independent and it uses c++ :)

There is tremendous potential in MoSync, and it is realising it power. With the release of MoSync 2.5 alpha native development support for android and iphone is added , also openglES support is added.

So, stop waiting and go on to www.mosync.com, download the latest ide and start churning out apps.

Regards,
Ishan