Denied: Python Micro-Framework (Sinatra-like)
denied.immersedcode.org
denied.immersedcode.org
- github user created in April's 1st (http://github.com/denied)
- contact is an email link to Armin Ronacher (http://github.com/mitsuhiko), who actually published the denied code in github
- code basically just uses jinja2 and werkzeug, which are a template language and a web framework, respectively, which Armin works on
So... yeah.
I'm very much not saying that's what it is. Looking at the end it looks like an encoded zip file which the code extracts. Perhaps somebody else will be kind enough to run it and find out what it does. I'd feel too guilty, having told too many people not to do that.
Because it happens to use a base64-encoded string to obscure some of what it's doing? Yes, there's malware which does that, but this is also such an ancient trick in humorous code obfuscation that it seems silly to jump to the level of paranoia you're displaying (especially given that A) it's by a well-known member of the Python community and B) it was published April 1).
armin.ronacher+dontbelieveanythingontheinternet@active-4.com
So.
I haven't looked at the source, and the documentation is nonexistent, but the example app and the routing look really close. See http://bottle.paws.de/ also.
Edit: Made comment a little less harsh :)
Every new framework copies something from existing ones. Setting routes with a decorator seems pretty obvious if you've seen Sinatra, and the templating language is more inspired by Django than anything else.
However, I do have to point out that denied is a joke which should be pretty obvious from reading the source and watching the screencast (and quite frankly, just by looking at the website in detail).
http://github.com/toastdriven/itty/
It's a self-described "little-experiment" based on Sinatra.
If it wasn't actually an April fools joke, bad form.
or why one would ever want to deploy server-side python code in this manner.
here's the one-liner to extract it btw: tail deny.py -n1 | cut -d\' -f4 | base64 -d > denied.zip
I'd hate to submit patches to this.
if __name__ == '__main__':
run()
Am I the only one who thinks that this is just plain horrible? It's incomprehensible voodoo.http://effbot.org/pyfaq/tutor-what-is-if-name-main-for.htm
I do agree though, it would be better to remove the if statement altogether since it's unlikely to be imported as a module.
There is another example of really bad API in denied: there is a template render function internally (you have to read the code behind the code to see that) which magically accepts both filenames for templates and template source strings. And there are a couple of more examples of really, really bad ideas in that code.