
The FuqIt Web Framework - superchink
https://github.com/zedshaw/fuqit
======
zedshaw
Well must be a slow news day today so I'll say a few things about FuqIt for
the high-minded HN crowd:

1\. Don't run this at all in anyway that someone can access it. It's ultra
hackable. Extra points if people can point out why.

2\. I basically am just goofing off. The idea though is this thought: "What if
PHP got it right?"

3\. There's some little tricks in there you may not have seen before. Take a
look at the code if you're new to Python.

4\. If I get around to it I may write a web server for this using my various
web-server-maker chops and put in some of the Lamson code and then make it
talk to ZeroMQ off of a URL similar to how it's doing jinja and python so it
can be a full service web+email+messaging system configured off just files in
a directory and then probably I'll get bored and do something else.

Enjoy!

~~~
rdtsc
Hey Zed that's pretty cool.

I think this was submitted with a back-thought of possibly generating
ridicule. It doesn't matter, anyone coding and playing with shit like this
gets upvotes from me.

I also like web.py (the framework conceived and built by Aaron Swartz) for
some of the same reasons -- simplicity and cleanliness. Start with something
like "let's see how would a clean and simple web framework look like in
Python." That's beautiful I think. Yeah I know it hasn't exactly taken off and
flask and friends surpassed it but I still like it.

EDIT: corrected Aaraon Swartz's name (thanks bensw)

~~~
vph
>That's beautiful I think. Yeah I know it hasn't exactly taken off and flask
and friends surpassed it but I still like it.

That reason it still hasn't taken off is that Aaron is very like Zed; they are
grasshoppers. They get bored easily from doing something.

~~~
toyg
:s/is/was/

:(

------
zedshaw
Thanks everybody, you made this joke possible:

[https://github.com/zedshaw/fuqit#investor-
statement](https://github.com/zedshaw/fuqit#investor-statement)

------
gojomo
There's a niche for something that's as sloppy-easy-to-get-started as PHP, but
with a more concise/consistent/powerful language. Perhaps, a "PYP" \- Python
with PHP characteristics.

This is a little like that.

~~~
synparb
I feel like [http://aspen.io/](http://aspen.io/) sort of does something like
this already. Written in Python and just uses the filesystem to generate
content rather than a MVC.

~~~
jamwt
Yes, I really feel like aspen is exactly this, and very well done too. Already
has real-world things running on it, like
[http://gittip.com](http://gittip.com) .

------
toyg
Excuse my French, but... if this hadn't been written by an internet celeb,
nobody would have given two shits about it.

~~~
zedshaw
Pretty much.

Oh, except, there's actually an interesting idea in there if you look really
closely.

~~~
nostrademons
Isn't the interesting idea basically CGI?

~~~
zedshaw
If you can abstract everything to be anything then nothing has meaning.

~~~
GabrielMtn
Lovely bit o' philosophy there. _no sarcasm_

------
d0m
Just wanted to say a special mention to the knife_or_banana method:

    
    
        def do_GET(self):
                try:
                    self.knife_or_banana(self.path)
              [...]
    
        def knife_or_banana(self, path):
                # THIS AIN'T THAT SECURE, BUT FUQIT
                 root, ext = os.path.splitext(path)
    
              [...]

------
ricardobeat
Out of my own boredom, fuqit in node.js:

[https://github.com/ricardobeat/fuqit](https://github.com/ricardobeat/fuqit)

~~~
zedshaw
Nice. Here's a present for you
[https://github.com/ricardobeat/fuqit/issues/1](https://github.com/ricardobeat/fuqit/issues/1)

------
Jach
This has too much functionality. Sometimes I just want to statically serve all
the files in a directory and its subdirectories.

    
    
        cd not_my_porn_folder
        python -m SimpleHTTPServer

------
Demiurge
Brilliant. I am supercharging it with dilithium crystals and replacing all my
production Django sites right this second.

~~~
zedshaw
Let me know where they are so I can steal your password files with my uber
secure file resolution code.

~~~
Demiurge
They are actually inside the NSA ring 0, vacuum isolated, prisming zetabytes
of privates emails and facebook lolkatz.

------
zokier
> FuqIt is Copyright (C) Zed A. Shaw _All Rights Reserved_.

[emphasis mine]

That's an interesting approach. I take that Zed doesn't want this to be
actually used anywhere?

~~~
dpe82
Good catch. Without an explicit license grant forking the repo is technically
copyright infringement.

~~~
jrockway
And a violation of Github's ToS.

(Interesting reading:
[http://cr.yp.to/softwarelaw.html](http://cr.yp.to/softwarelaw.html))

------
pdevr
[https://github.com/zedshaw/fuqit/blob/master/app/files/index...](https://github.com/zedshaw/fuqit/blob/master/app/files/index.py)

    
    
      return "I Am KING!"
    

[https://github.com/zedshaw/fuqit/blob/master/app/files/test....](https://github.com/zedshaw/fuqit/blob/master/app/files/test.html)

    
    
      I am a test Jinja! 
    
    

So, which one is it?

~~~
zedshaw
Maybe I'm King of The Jinjas!

~~~
T-R
King of the shrines?

~~~
yxhuvud
Gotta start somewhere.

------
brooksbp
Why is this front page? Because he is a celebrity? If Python is the drug of
choice, Flask. K? Thx, now get off my news feed.

------
benhsu
how the fuck is this the top link on HN right now?

~~~
zedshaw
It's almost like I'm famous and people are interested in what I do!

~~~
hayksaakian
I've never heard of you, but I liked the idea behind a PHP replacement.

~~~
Demiurge
In my experience with a new PHP developers, the first hurdle is explaining
that urls have nothing to do with the filesystem.

~~~
hayksaakian
(I don't do PHP) I had the same issue starting with using web APIs in java.

It's understandable though as the early web was essentially serving a
filesystem directly (almost ftp).

------
dave84
This is one of those things that becomes immediately "obvious" the moment I
see it... but I'd never have thought of.

If we could decrease the amount of understanding required (possibly a bad
thing) to get python running on the server it would be great.

Why can't I just go "python app.py -port 80" and call it a day? What would we
need to get to that point?

~~~
krapp
_What would we need to get to that point?_

To be using PHP.

(runs away)

------
rman666
Would fans of FuqIt be "Fuqers"?

~~~
Ygg2
Yes.

------
hobs
Good use of lens flare.

------
joshguthrie
I was intrigued by the reference to Meteor and after a bit of googling "oh
yeah okay, those guys who did an unsecure NodeJS realtime framework (last time
I used it, every client could call the mongodb database) just got 11M in
funding".

When did our jobs become such a joke?

~~~
qiqing
There's a package called 'insecure' that is included by default to get the app
up and running as quickly as possible. To remove, just do $ meteor remove
insecure

Hope this helps!

P.S. docs.meteor.com is very helpful -- I highly recommend reading it. Also,
DiscoverMeteor.com is a great textbook that will cover this material.

------
revskill
The first version now is minimalistic. But to be a second Ruby on Rails
framework, your system will get more complicated soon. Good luck.

~~~
zedshaw
You obviously know nothing of my work.

~~~
SkyMarshal
Didn't you know, any sufficiently complicated Python framework contains an ad
hoc, informally-specified, bug-ridden, slow implementation of half of Ruby on
Rails.

------
hoodoof
Anything by Zed Shaw is interesting. One of the real software engineers. Or
should I say "Programmers, Motherf..."

------
abootstrapper
Juvenile. If this had any other name or was written by anyone else, no one
would give a fuq.

------
NAFV_P
That is a terrible name for a framework, you should have called it 'shdvg'.

------
recuter
Oh Zed.

------
bobwaycott
That mascot is fucking awesome.

------
reebalazs
Hi Zed,

you nailed the name just right, but a single look at the mascot made me blind
for an hour.

And it's already ported to NodeJS, congrats!

