Wednesday, August 3, 2011

Teaching While You Work: Webob, Django, and App Engine

I have two interesting tasks on my hands.

1. Write clear code, suitable for teaching.

2. Write a usable -- functioning and secure -- loan-management system.


At the same time, of course.  Otherwise I'd just get my kluge hat on.

It's all going on app engine, of course.  You think I want to do auth myself?


I looked at two tools: WebOb and Django.

Django is a full-stack database-driven framework.

WebOb is a wrapper for WSGI environments.

I decided to use WebOb for two reasons, one for each of my tasks:

1.  WebOb is simple.  It requires no regex url matching, and no black magic import statements.
WebOb does what you call it to do, nothing more.

2.  Django dosen't get along with App Engine.  If I used Django, I would have to use the Django-nonrel fork, or this lengthy patch.  Further, Django has its own auth system, which would take teasing to use with App Engine.

Friday, June 17, 2011

Work Log: Fri, June 17

9:00
Arrived 8:30
Will work on the Zoo DAL project, and setting up the zoo online.  If both of those are complete, I hope to go home on the 12:30 bus.
Figured out what was wrong with the Roll app: 'name' attribute in the HTML helpers needs an underscore. This is an unpredictable aspect of HTML helpers.
It's done, though.  Just going to pack it up and set up the zoo.
10:00
Waiting for Matt to come and discuss the Zoo's location.
11:00 
Matt agreed to use Launchpad.
12:00
Going home at 12:20.
Getting timesheet signed first.

Thursday, June 16, 2011

Work Log: Thurs, June 16

9:00
Arrived 8:25
I'm working on the fibonacci sequence generator.
Web2teach is down and my app is having a mysterious syntax error.
Investigate other apps?
10:00
Still working on the zoo.  Should I centralize it?
11:00
Zoo's fibonacci generator is done! It was missing a paren.
Next I will work on the DAL, for the long-term project of putting CheckItOut on Google App Engine.
12:00
Learning to work with the DAL, writing a roll records system.
1:00
Still working on the roll system -- it's not writing to the database, or my query is wrong.
2:00
Working on the roll system -- it is extremely difficult to learn how to work with the DAL.  Learning is difficult; the web2py book does not have references to good, detailed information on how to use introduced tools.

Wednesday, June 15, 2011

Web2py Applications

Here, we'll link web2py apps in any way possible.
Here's powersteps, which shows forms and HTML helpers, on dropbox.
Here's echoname, which shows the power of templating, on dropbox.
Here's Fibonacci, which uses a blank template, on dropbox.
Here's Roll, a simple DAL using application for taking roll, on dropbox.

Work Log: Wed, June 15

9:00
Arrived 8:25.
Working on web2py powers app.  What HTML helpers do i have?
10:00
App is done.  Of course, the next one will have to show a different idea.
Four lined up: First, show templating, then Security, then pretty layouts (based on default), then the DAL, if I dare approach it again.
Templating is just a bad idea.  It's unwise to show kids the WRONG way to write in a framework.
I'll skip to layouts -- Security must come after the DAL since it's database-driven.
Layouts, upon close inspection, are unavoidably too complex for beginners.
11:00
I'll write a simple example of templates.  Templates are best for operations that will be done once, such as working with a name... so I'll write a postbacking rig that greets someone.
However, there is some impenetrable error message, and the most simple app is not working.
12:00
App debugged.  For a piece de resistance, I'll learn how to set up SSL while Stavros figures out auth tables with the DAL, which he's already learning to use.
And, why not write a proxy, should I finish before Stavros?
1:00
Working on web2teach, another gctaa server.  It seems to need auth, or it won't run.
Either way, SSL is set up.  So, I'm going back to the book to see what other ideas I can put in the zoo.
2:00
Another addition to the zoo would be a blank-template app, which would get students into the web framework mindset.  What should it do?

Tuesday, June 14, 2011

Work Log: Tues, June 14

9:00
Arrived 8:20.
Got on IRC to find a solution.
Lifeeth's python package will install semi-globally; a simple script will allow users to set up web2py.
10:00
Investigated using the PyPI package.  It's a complex solution, not sustainable -- we'll be working on the debian package.  I'll learn Web2py.
11:00
Lunch.  At 12:30, I'm going back to Yorktown to talk with Ms.Ingram, and then home, where I'll learn web2py.
12:00
Ms Ingram actually can't meet today.  i'm still at the career center, fed and ready to go.
Learning how to use the DAL, implementing a mathquiz high score.

Monday, June 13, 2011

Work Log: Mon, June 13

9:00
Arrived 8:50.
New objective: implement checkItOut with Web2Py.
9:19: Got web2py -- and Mathquiz -- running.
10:00
Got Mathquiz running with an average time function.  Reading pep8, and working on python style.
11:00
Continuing reading pep8.
Made my controller Pep8 compliant.
11:30, researching Kickstart -- Can't find a tutorial.
12:00
Reading up on the web2py DAL.  I'll be going to lunch while the VM installs.
1:00
Installed the VM, reproduced the error -- but it is mystifying since manually deleting the missing file is recoverable on the basic install of the same package.
2:00
The error won't go away.  It seems I'll have to use the source install until the package is fixed.