Dusty,
Can we move this on-list? Makes the project look livelier. :D
How do you suggest handling form validation? I have been experimenting with pycerberus, which I like better than formencode because a) it's not Ian Bicking, and b) the html fill library scares me.
Any of the above. Aspen doesn't bundle a form validator and I don't really have an opinion (I'm happy to roll my own--though it's good to know about pycerberus). Would be a good tutorial. :)
Second, how do I make Aspen display the body of an error Response issued using raise instead of rendering an error message? I basically want to abuse HTTP in a way that I think it should be abused such that I'm attaching a json response to a 406.
Is the non-error response also json? If so try modifying the "response" object in your simplate and letting it fall off the end instead of raising it, like so:
/myfile.json
^L
good = request.qs.one('good')
if good:
response.body = {"success": True}
else:
response.code = 406
response.body = {"success": False}
Third, I feel like having "blah.html" in my urls is a lie when I'm rendering dynamic code, and also not clean. Any suggestions?
May I try to explain Aspen's point of view? The Content-Type refers to the type of the content as delivered to the client, and that's what Aspen uses the file extension for, because there's a mature infrastructure for that (mime.types files + the python mimetypes module). From the outside world's point of view (sez Aspen), who cares whether it is dynamic or static?
In other words, Aspen thinks the .html extension is the truth, and clean.
If you want all your URLs to end in / you can make them all directories. Mongs does this to a certain extent.
Can I just name the file NO_EXTENSION? Can I set the mime-type dynamically or does it have to be set in the simplate?
If you really want naked URLs (no slash, no extension) then you have to do it manually in 0.14.x: response.headers.set('Content-Type', 'foo/bar').
chad