Перейти к файлу
Anders Hellerup Madsen e66d765aa1 First version of a django compatible template system. Parser and tokenizer are somewhat usefull.
Text literals and variable tags (TODO: filters and escaping) and variable scoping are implemented.

Template tags implemented:
    For
    If

TODO:
 - parsing and executing is done outside of a scope that djangode can track, which means the server dies on errors instead of reporting 500.
 - implement filters and escaping of variables
 - implement more standard django tags
 - implement more standard django filters
2009-12-09 02:53:28 +01:00
static-demo Added example.js and bulked out the readme a bit 2009-11-20 10:06:16 +00:00
templates First version of a django compatible template system. Parser and tokenizer are somewhat usefull. 2009-12-09 02:53:28 +01:00
README.txt Added example.js and bulked out the readme a bit 2009-11-20 10:06:16 +00:00
djangode.js Fix for the previous too quick utf8-fix 2009-11-28 08:05:40 +08:00
example.js 2009-11-27 17:12:28 -07:00
template_defaults.js First version of a django compatible template system. Parser and tokenizer are somewhat usefull. 2009-12-09 02:53:28 +01:00
template_example.js First version of a django compatible template system. Parser and tokenizer are somewhat usefull. 2009-12-09 02:53:28 +01:00
template_system.js First version of a django compatible template system. Parser and tokenizer are somewhat usefull. 2009-12-09 02:53:28 +01:00
template_system_test.js First version of a django compatible template system. Parser and tokenizer are somewhat usefull. 2009-12-09 02:53:28 +01:00

README.txt

djangode
========

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

    http://nodejs.org/
    http://www.djangoproject.com/

Example usage:

    var dj = require('./djangode');
    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 example.js" for a slightly more interesting example.