Tuesday, February 14, 2006

Django again...

After following tutorial 3 without much problem, stuck at tutorial 4 for a long time. I think the problem is that I kind of stop start with the tutorial, which put me off a bit from my learning rhythm (if there is such a thing). Resume with the tutorial after a 2 or 3 days break make me lost out on the continuity, I just forgot why I change this file and add that codes, etc.

Anyway, that is my excuse for why I can't get the first part of tutorial 4 working. Following the "writing a simple form" steps by steps, till test the app by starting /polls/1 , but get a long error message which I have no idea at all where it come from. Try to rollback to where I started at tutorial 3, steps by steps, and still can't see where I go wrong here.

So, leave it for two days, try again this morning. And finally able to see what should be an obvious error all along, first thing, I didn't create the detail .html as template, second, the results template I create actually named "result.html" instead of "results.html"... This is really silly, why can't I see it much earlier? Hmmm....


So now, I can see the voting screen as below when I run the /polls/1.














And click on a radio button, select either "Not much" or "the sky", submit the vote, get you this.











Phew, I guess finally I get it right. But to be frank, I didn't understand most of the codes in tutorial 3 and 4. Though I try to read through and digest it, but sometimes I get really frustrated that I just follow blindly by copy and paste the code. I know this is not a good approach to learn something, so what I plan is to finish off tutorial 4, and write down what I have learn so far throughout this 4 tutorials, I believe that if one could explain what he is doing, then he should have a good understanding of it.

3 comments:

Yannick said...

Yeah I finished tutorial 3 the other day and started tutorial 4, but I can definitely identify with what you are going through. It's tough when you start and stop and start and stop. It does make you forget what you did before.

Keep at it though. Don't give up. You'll get better at it.

kahfei said...

Thanks again for the encouragement. Will keep working with Django.

Yannick said...

No Problem. You are most welcome.