There was no way I was going to get the TomsGiftList project into a usable state any time soon. I decided to try and setup GiftWeb again and guess what? It worked! The reason for it breaking 18 months ago seems to have disappeared. I did not even have to change the include path for the ADODB library which I had the last time I tried GiftWeb.
I still don't like GiftWeb even though it saved the day. It is an old PHP application. When I tried the "recommended" PHP configuration for production use, GiftWeb crashed. This worries me a little. I hope that I have not exposed my server to an exploit. GiftWeb was the first and only PHP application that I ever played with, and the experience made me like Python even more. Of course at that time (2003) the Python web frameworks were a little less mature than they are now, so CGI was really the only option for writing Python web applications. No thanks.
I'm glad I was able to get the wish list back online. Nevertheless, it is only three weeks to Christmas so I don't how much help it will be to everyone.
(It was a toss up between Clint Eastwood and Kenny Rogers. :)
Showing posts with label tomsgiftlist. Show all posts
Showing posts with label tomsgiftlist. Show all posts
Monday, December 1, 2008
Sunday, November 30, 2008
Rough Weekend
I was hoping to get a lot done on the TomsGiftList project this weekend. Although I did make some progress, it was mostly an exercise in frustration. The goal was to have a user registration and login functional enough for testing. I'm not even close.
On Saturday, the big mistake was not splitting the registration web page specification into smaller units. By attempting to complete everything, I wasted a lot of time on functionality that could be done later. I dived in too fast and paid the price.
Sunday, was a different story. I needed the database model working to bridge registration and login. I played with SQLAlchemy before so I had some examples that worked. All I need to do was figure out how to integrate it with Pylons. Do you think I could find a Pylons example that worked? Every example on the Pylons web site had a problem, and without knowing more about Pylons, it was impossible to fix anything. Eventually, the Pylons Book SimpleSite Tutorial worked which was a relief. I'll have to remember to try there first next time I need help.
With a database connection setup, I can proceed with making the web pages do something useful.
On Saturday, the big mistake was not splitting the registration web page specification into smaller units. By attempting to complete everything, I wasted a lot of time on functionality that could be done later. I dived in too fast and paid the price.
Sunday, was a different story. I needed the database model working to bridge registration and login. I played with SQLAlchemy before so I had some examples that worked. All I need to do was figure out how to integrate it with Pylons. Do you think I could find a Pylons example that worked? Every example on the Pylons web site had a problem, and without knowing more about Pylons, it was impossible to fix anything. Eventually, the Pylons Book SimpleSite Tutorial worked which was a relief. I'll have to remember to try there first next time I need help.
With a database connection setup, I can proceed with making the web pages do something useful.
Friday, November 28, 2008
Pylons
So far I am happy I choose Pylons for the TomsGiftList project but a lack of documentation is slowing things down. So far I have a simulated login page which is not very much at all. I had trouble with login failure. The problem was how to display the login page with an error message. I first tried a redirect but that was never going to work since there was no way to pass data to the redirect. I found a better way to do it.
Pylons allows any URL to be mapped to any controller and action. You configure this in the routes.py file. You can also set specific conditions for the mapping like this:
Pylons allows any URL to be mapped to any controller and action. You configure this in the routes.py file. You can also set specific conditions for the mapping like this:
map.connect('login', controller='login', action='check',\
conditions=dict(method='POST'))This maps URL /login POST requests to the check method of the login controller. The path is still /login so no redirect is required. It is much more elegant but I only discovered it by accident in the Pylons tutorials. Who knows, there may be a better solution.
Tuesday, November 25, 2008
Online Wishlist
A few years ago I setup an online Christmas wish list for my family. It was just a PHP program that I found on the 'net, but it worked OK. Last year I had some problems on the server which broke the wish list application. I never fixed it and thought that no one would notice. I was wrong. Most of the family missed the wish list to some extent.
My plan was to write the wish list application from scratch. I wanted to try some web development in Python and this was a good opportunity. I had a year to do it, plenty of time, right? Nope. I really don't know why nothing happened. I was not very busy during the summer. I have no excuse really. With only four weeks until Christmas, I debated whether to even bother now. Its really only 2 weeks if the wish list is going to be useful at all, since most people only shop the week before Christmas.
Anyway I decided to try anyway. I'm not sure what this says about me. Am I the world's greatest procrastinator? Or maybe I just don't know a lost cause when I see one. Anyway, if the application is not functional this year, at least I'll have made a start for next Christmas, although the family may have given up on me by then.
My plan was to write the wish list application from scratch. I wanted to try some web development in Python and this was a good opportunity. I had a year to do it, plenty of time, right? Nope. I really don't know why nothing happened. I was not very busy during the summer. I have no excuse really. With only four weeks until Christmas, I debated whether to even bother now. Its really only 2 weeks if the wish list is going to be useful at all, since most people only shop the week before Christmas.
Anyway I decided to try anyway. I'm not sure what this says about me. Am I the world's greatest procrastinator? Or maybe I just don't know a lost cause when I see one. Anyway, if the application is not functional this year, at least I'll have made a start for next Christmas, although the family may have given up on me by then.
Subscribe to:
Posts (Atom)
