2007-10-29

web.py update 3 (and tough bugs)

My new application on web.py framework works great. I eliminated slowness issue during installation of new web.py environment.
It was caused by opening db connection without pooling- and it took really long time (about 10 s). So next time I properly installed DBUtils. Run tests and found exception raised by web.py database. I had to make quick fix in my web.py installation - changed name of one of parameters in DBUtils function call.

Few days ago I tested web.py session support and authentication in my application. It worked good, when something broke next day. I had feeling that session isn't properly stored or recalled- and my authorization module redirected me to login page. Access logs showed me that actually I requested only login page, not any other. Strange. I was looking for bug in web.py, but there had to be another reason I thought at end.
I used another web browser- in my case IE. Login and session worked well, better than under Firefox. The reason causing problem was performance enhancing plugin for firefox I installed few days ago to tune in new Firefox. It used strange caching algorithm, and every time I hit some application page login page was loaded. Probably it was first page cached by plugin. I uninstalled it and reviewed other browser modifications.

Once again experience shows that the most time consuming bugs are simple and just hidden in area assumed for sure as free of bugs (in my case I was looking in server app, but bug was caused by browser client modification).

2007-10-22

Additional insights about Web.py (update 2) - sessions and slowly pages

I have used default branch of web.py framework for prototyping purposes. As my web app needs sessions and there is no bult in session support, I tried to use flup and beaker modules. Meanwhile I realized that there is another branch of web.py with simple sessions.
It is handling session storage on database or files, and has typical session api (although simpler than beaker). It is all what I needed.
If you are using bzr already you can get web.py with sessions directly from repository:

bzr branch http://bazaar.launchpad.net/~karol.tarcak/webpy/webpy.sessions.branch webpy

Another issue is slowly page generation. I think it's matter of using uncached templates, but this is unevitable during development process. Maybe database connection also adds its workload, I have to check it. Now every page loads in about 10 seconds- it's slower than compiling jsp page on the same machine. I'm going to investigate the subject and return to process of happy-snappy coding.

Maybe you found anything what can speed up page generation- please share your experiences. I'm waiting for comments.

2007-10-16

Prototyping with Web.py - the light web framework

Welcome again

Last week I started in cooperation with my friend small personal investment tracking application project. It's still in designing stage, maybe I will write something about that later.

I decided to write basic functional prototype using python, having in mind that it can be production environment. Because it is going to be a web application I reviewed current python web frameworks.

There are interesting solutions like Django or Pylons, but I would prefer to use simple but flexible frameworks for that scale of project. So I decided to use web.py - simple framework made by creators of reddit.com.


Web.py has really simple skeleton connecting together http server, controller engine and built in but loosely coupled database module and template engine. It needs minimum configuration to run. In default mode it uses WSGI http server, with option to switch to fastcgi on apache or lighttpd. The same with other modules. You can use other full fledged db framework or better known templating engine. There are no fancy helpers and component support, but it's easy to include existing solutions.

It reminds me another web framework having similar attributes - java Maverick. It have more features, but the same spirit of simplicity.

If you are ready to use light web framework try one of these, or find something like that. Bigger and having more features not always means better.

2007-10-07

bzr - the light version control system

I have many personal tiny projects and sometimes I need to synchronize all files and documents between laptop and my workstation (and sometimes one extra workstation). I used pendrive as common drive for all kind of that stuff. Sometimes I forget pendrive so I worked on local filesystem. As result sometimes I had semiautomatic synchronizations nightmare- sync all local directories with pendrive as central storage drive. It was the last moment to change it.

Most time I'm online so I thought about network accesible repository for my projects. In my professional work I use repositories like CVS, SVN, and Perforce. Version control system is good solution but I wanted to avoid burden of instalation and hosting of such services. Rsync is good and simple solution too, but I started thinking about something like light, open source VCS.

So I have tried Bazaar (bzr). It is real VCS and meets my all demands. And it has one big positive- it doesn't need server instalation so I can use various protocols like ftp on repository host. There are examples of using bzr only with http protocol to checkout project (no writing and creating projects in repository of course).

So I tried to setup repository over sftp. New version of bzr is written in Python, but I had presintalled Python environment already. I installed bzr package, and paramiko needed for sftp connections handling. I have run bzr on windows and linux - there is no major differences. It's good to read the installation requirements if you are not using standalone instalation packages.

I wrote some automatization scripts to update my projects before work and commiting changes after. It works pretty well. There is one negative- all bzr users point that bzr over sftp works very slow. I can confirm that even on small size projects it takes even 20 minutes to checkout all files. But bzr team is still working on it and communication optimization is one of their priorities.

2007-10-01

Are you Vista ready?

We have interesting situation at the operating systems market. People don't adopt Windows Vista as fast as Microsoft planned, so Windows XP is still a valuable platform and it will be longer available. Even some Vista license buyers are allowed to switch to Windows XP.
It's good time for multiplatform and web application developers.

What do you think about it?