Why Python for web-development?

We had a discussion about Python for web-development a while ago. And now I would like to give my voice out why Python rocks for web-development.

As you may know I use Python for most of my web-development and I have used Python the past 4 years.

The top reasons why I use Python:

  • Python is a beautiful language - the most beautiful for me
  • Python standard library ROCKS
  • Python is very well tested
  • Python supports Unicode
  • WSGI convention makes it possible to build your own framework in some hours!
  • Python scales (look at reddit.com)
  • There are tons of great web-frameworks: CherryPy, Pylons, Django, web.py... Just to name a few
  • Need smart database support? SQLAlchemy, amidb or Dejavu...
  • Need a template system? Well, in Python you have a lot of quality choices: Cheetah, Jinja or Mako... Just to name a few

And then? Well, let me show you how beautiful Todoist code is.

Controller:

@amiweb.expose
def getViewAll(self, dates, cur_date):
    data = AgendaModel().getViewAllModel()
    return json.write(data)

Model:

def getViewAllModel(self):
    data = []
    projects = ProjectsModel().getAllActive()
    for project in projects:
        items = project.getUncompletedItems()
        if len(items) > 0:
            data.append(
                    {'project_id': project.id,
                     'uncompleted': items,
                     'completed_count': project.getCompletedCount(),
                     'history_max_order': project.getHistoryMaxOrder(),
                     'cache_count': project.cache_count})
    return data

You see, working with such beautiful code makes you productive!

But what about hosting? Well, hosting is really cheap nowadays. Dreamhost starts at $8 pr. month and you can get expert Python hosting at WebFaction for 7.5$ pr. month.

My conclusion is that there are very few reasons why not to use Python for web-development!

Be different, be productive, be yourself -> Pick Python!

Code · Python · Tips 22. Jun 2007
© Amir Salihefendic. Powered by Skeletonz.