Utilities functions for node.js that borrow some useful concepts from Django
JavaScript Python
Pull request Compare This branch is 146 commits ahead of tomcarver:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
djangode
examples
static
tests
.gitignore
README.md
TEMPLATES.md
license.txt
package.json

README.md

djangode

Utility functions for node.js that imitate some useful concepts from Django.

Example usage:

var dj = require('./djangode/core');
dj.serve(dj.makeApp([
	['^/$', function(req, res) {
		dj.respond(res, '<h1>Homepage</h1>');
	}],
	['^/other$', function(req, res) {
		dj.respond(res, '<h1>Other page</h1>');
	}],
	['^/page/(\\d+)$', function(req, res, page) {
		dj.respond(res, '<h1>Page ' + page + '</h1>');
	}]
]), 8008); // Serves on port 8008

Run node examples/example.js for a slightly more interesting example.

Templates

djangode provides an implementation of Django's template system; see TEMPLATES.md for more information, and run node examples/template_example.js for an example.