I'm trying to make our web designers will not see source code in
template files

is possible do this in django template system? there is something
similar?

Template - index.html

<html>
<head><title>Test</title></head>
<body>
<p>News</p>
{% block content %}
<p>New number {{ number }}<p>
{% endblock %}
</body>
</html>

Controller - test.py

def index(request):
    news = {1,2,3}
    t = loader.get_template('index.html')
    content = t.get_block('content')
    for n in news:
        content.start() # start 'render' new block
        content.set('number', n)
        content.end()
    return HttpResponse(t.render())


Regards,
Daniel


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to