If you have read Install Stackless Python on Ubuntu and could get stackless running the examples I showed you, then just follow these commands to get a stackless virtual environment running a nagare project called 'nagaredemo':
In the examples below, paste the code directly into the file
//negaredemo/demos/demos/app.pyand be aware that when you change the code you need to restart the development server (Ctrl-C stops it.)
Hello World!
Okay, so example1 shows the basics of rendering a Welcome object.
http://localhost:8080/demos/You'll notice immediately that we're not using a templating language here, but rather the built in Domain Specific Language (DSL). In reality you would use the DSL to build xhtml snippets and then use meld to insert them into templates. I've not used meld before, but it looks very straight forward - neat in fact. Now onto example2.
Callbacks
Here we've registered two callbacks on the DOM without having to explicitly declare the URL mappings. have a look at the rendered HTML to see how this has been implemented. Now, that's pretty handy.
Tiresome RESTful URLs
Example 3 takes that same code and augments it to allow us to have more ReSTful URLs. I'm not sure this is as obvious as I'd like, but it works I suppose.
http://localhost:8080/demos/Counter?value=7
Saving State Automatically
Nagare can hide the request/response object and global session from the developer. Object states are automatically saved in a server side session during the request/response round-trip. This allows for a more direct style of programming like in a desktop application.
And there's more
Conclusion
For example, saving state between requests is nice, but is it secure? Do I need to plough through the code to find out? In my opinion it would have been better to have offered a structure that allows for others to plug in solutions/implementations.
The documentation is somewhat limited, which is probably because the community is still fairly small. However sinceteh project has been running since 2008, perhaps that's something to be concerned about.
Thanks to Hervé Coatanhay for suggestion the illustrative code snippets.

One thing that you can help clarify is difference between frameworks that build web applications (like google docs) versus frameworks that build websites (blogs, cms, etc)
ReplyDeleteI like your blog, I read this blog please update more content on hacking, further check it once at python online training
ReplyDelete