

Denied: Python Micro-Framework (Sinatra-like) - thisduck
http://denied.immersedcode.org/

======
Gonsalu
I think this is supposed to be a April's fools joke.

\- 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.

~~~
jerf
What it looks like is a virus:
<http://github.com/denied/denied/blob/master/deny.py>

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.

~~~
ubernostrum
_What it looks like is a virus_

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).

~~~
jerf
As you agreed, it has visual similarities to a virus. That's all.

------
theli0nheart
This looks really similar to Bottle. <http://github.com/defnull/bottle>

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 :)

~~~
the_mitsuhiko
Werkzeug had an example with the same semantics (decorator for URL rules and
returning strings and response objects from functions) for a long time. But
neither did Werkzeug come up with that, the original idea was TurboGears which
did it that way. So by that logic, bottle is a cheap knockoff.

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).

------
telemachos
If anyone liked the idea, but not as a joke, there is itty:

<http://github.com/toastdriven/itty/>

It's a self-described "little-experiment" based on Sinatra.

------
brandon
To be frank, I'm not going to TOUCH a library that contains 400k of
base64-encoded zip data.

If it wasn't actually an April fools joke, bad form.

------
icey
The source is good for a laugh:

<http://github.com/denied/denied/blob/master/deny.py>

~~~
plq
okay, i can't figure out for the life of me why one would put source code in
such a format up in a public code repository.

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

~~~
tednaleid
Bragging rights about the whole framework "fitting" in only 47 lines of code?

I'd hate to submit patches to this.

~~~
bartl
405k. That's not my idea of "micro".

------
krainboltgreene
Not as pretty as Sinatra's example page, but I like the home page for the
project! Great name too.

------
oinopion
It would be good joke, only... Python has so many ugly web-frameworks, that
this doesn't make any difference.

------
bartl

        if __name__ == '__main__':
            run()
    

Am I the only one who thinks that this is just plain horrible? It's
incomprehensible voodoo.

~~~
csytan
This is commonly used in python modules which can also be run by command line.

<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.

~~~
the_mitsuhiko
Well, the run() function was intended to be a very bad example of API. Because
there is that magical application object you never see that run magically
picks up.

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.

