Wilson, a Django-inspired node.js framework
github.com
github.com
I propose a question to him and will do the same here: Why? Why not just stick with the existing framework?
Isn't there a better/ less frustrating/ more intuitive way to do frameworks? Is Django/ Rails really as good as it gets?
I don't know the answers. It's just a set of questions that I figured were important... Especially if you're going to get yourself stuck in to a project for a few months/ years.
Why not just stick with the existing framework?
Because there isn't one. Node is an evented, web-and-net-savvy I/O stack, with which you could just as easily write an IRC, HTTP or DNS server.
If you want to write a complete web application, you'd be better off writing less code on top of a framework than making lots of easy mistakes dealing with the entire stack.
Python has issues dealing with I/O due to the GIL. (Here come the downvotes) Node.js also has the benefit of cutting-edge VM development, an area where Python is catching up. Combine this with the prospect of having the same language on the client and server, and the whole package sounds quite attractive.
I'm still baffled by the amount of misinformation about I/O concurrency.
However the problem is not inherent to all GIL systems. Ruby 1.9 also has a GIL but does not suffer from the problem of running slower on dual core than single core.
One of Wilson's goals is to be comfortable for Djangonauts who, for whatever reason, need to write Node.js code. To that end, the ORM, view layer, and template system are similar to Django to ease use in that particular case.
The other boon to having a largely cross-compatible template language is that it allows a bit of bootstrapping to occur for Wilson projects -- Wilson could conceivably make use of Django's admin templates at some point, if that's the direction it's going to head.
However, Wilson does diverge pretty rapidly from Django in other areas -- it borrows Django's concept of apps, but in Wilson apps are designed to be pluggable; you can install a single app multiple times under multiple aliases, reopen app instances from the project level and change their settings and models before they're finalized, etc. Within the context of an app, you interact with other apps through "externals" that are resolved at project-level.
The other major difference is that wherever possible, I'm hoping to keep the libraries that constitute Wilson separate -- and wherever it makes sense, to make them also operable in-browser. To that end, Platoon (the testing framework), Plate (the template language), Escaperoute (the router), Pieshop (the ORM), and postpie (the ORM adapter to Postgres) are all kept as separate libraries; Pieshop and Plate are actually designed to be run in-browser as well, in preparation for the eventuality of needing to interface nicely with a Wilson app from the client-side.
So in summary: Wilson isn't a one-to-one port of Django -- it's heavily Django-inspired -- but aims to diverge wherever it is sensible to do so.
simonw hasn't worked on it in a while, but it's been forked a bit to keep up with the latest node. It doesn't give you an orm but does basic regex routing and django style templates.
Edit: thanks for the link!
I'll push up some updates to the example tonight, and I plan on updating the docs within the week.
EDIT: The docs are updated and the example is too. Whew!
http://docs.djangoproject.com/en/dev/topics/testing/ http://docs.djangoproject.com/en/dev/topics/templates/#autom...
As for REST, Django speaks HTTP - it's really not hard to build a REST API with it. There's also Piston: http://bitbucket.org/jespern/django-piston/