4 ms·
Interesting. Both are great frameworks. My thoughts are: I like how django lacks all that directory structure and you can easily use a single file for your m
by grandalf 16y ago
Interesting. Both are great frameworks. My thoughts are:
I like how django lacks all that directory structure and you can easily use a single file for your models.
Django templates are way more powerful and safer than erb / haml, etc.
I wish there was a port of django templates in ruby. If so my preferred environment would be sinatra + datamapper + django templates.
- johnnygood 16y agohttp://ruty.rubyforge.org/ http://ruty.rubyforge.org/ Ruty hasn't really been maintained, but it is pretty close to Django's templating system. Apparently, there's even been a little work to get it together with Sinatra (http://github.com/eladmeidar/sinatra-mvc/blob/master/app/helpers/ruty.rb http://github.com/eladmeidar/sinatra-mvc/blob/master/app/hel...). I haven't used Sinatra, but I have played with Ruty and it's pretty nice and supports things like Django-style inheritance. It's a pity it never took off and this isn't a complete answer to your desire, but it might be an interesting place to look around.
- grandalf 16y agooh very cool thanks for the link.
- carbon8 16y agoThere's also mustache (http://github.com/defunkt/mustache http://github.com/defunkt/mustache) which has some similarities to django templates and is pretty popular. "safer than erb / haml, etc" Are you are referring to auto-escaping strings? If so, in Rails 3, this is on by default, and for Haml without Rails it's a simple setting.
- grandalf 16y agoI use Mustache and like it very much, only I find that I wish it offered support for a few of the features in Django templates such as dot notation. I was referring to the auto-escaping as well as to the inability to run arbitrary code inside a template (for all I know this feature is added to the newest versions, though)