I don't understand why almost every (except for Django) framework author insists on hiding regular expressions in his routing scheme and instead forcing developers to use his homegrown language with slashes hardcoded. It's not like the developers are afraid of regular expressions, are they? This is so painful, i have to undo the work of those routers sometimes to get the results i want.<p>Luckily this is Python so it's possible to monkeypatch the implementation.
Juno looks to be simple and the developer has chosen a good set of libraries to build it on. It is a demonstration of the inherent simplicity in using well written, WSGI aware python libraries.<p>IMO, web.py qualifies to be called "really lightweight"<p>take for instance the hello world code:<p><pre><code> import web
urls = (
'/(.*)', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name):
if not name:
name = 'world'
return 'Hello, ' + name + '!'
if __name__ == "__main__":
app.run()
</code></pre>
This has two advantages over the Juno code..<p>1. more `REST`y (GET/POST)<p>2. `app` object is a wsgi callable..<p>More importantly, web.py does not need have any external library dependencies unless you choose to use mysql/postgresql when you have to install the db interface libraries. I had problem running the hello world Juno code because I did not have pysqlite2 installed.. huh? why do I need pysqlite2 to return a string?<p>While some may object saying that web.py has a case of NIH, the code of web.py itself does not reflect any such attitude. The whole library is just a directory of aptly named modules. You can plop it anywhere in the python path and start coding ..
Very cute. Reminds me of a cross between Ruby's Sinatra (<a href="http://sintrarb.com/" rel="nofollow">http://sintrarb.com/</a>) and Ramaze (<a href="http://ramaze.net/" rel="nofollow">http://ramaze.net/</a>) without obviously being inspired by those :)
The idea of routing annotations is used extensively in the Recess PHP Framework, except that in Recess the annotation also takes the HTTP verb (GET, PUT, POST, etc.) to make beautiful, RESTful URLs even easier to work with.<p><a href="http://www.recessframework.org/page/routing-in-recess-screencast" rel="nofollow">http://www.recessframework.org/page/routing-in-recess-screen...</a>
wow
init({'middleware': [('paste.gzipper.middleware', {'compress_level': 1})]})<p>dict holding list holding tuple holding dict :) no biggy to throw a wrapper over it though. Is it possible to place all the routes in one place you think with this? I am worried with a larger project I will forget which module contains what url... Unless there is some convention for url path->module name (if there isnt I would suggest establishing one). A suggestion I would have is standardize on some templating so if people end up using this there wont be a person using a different available one. (<a href="http://wiki.python.org/moin/Templating" rel="nofollow">http://wiki.python.org/moin/Templating</a>) I noticed <a href="http://karrigell.sourceforge.net/en/pythoninsidehtml.htm" rel="nofollow">http://karrigell.sourceforge.net/en/pythoninsidehtml.htm</a> was not on that page though... albeit its more like php.
I really like Juno. It's very small, and quite elegant, and it mostly feels like Python (rather than a DSL-ish framework). My only issues are that the URLs are tightly coupled to the controllers--from a stylistic point of view I prefer to manage the URLs in a single place (since they're both related but different).