django-awesome-templates is a Django app that contains awesome templates for Django, to do web programming the right way.
Finally a sane way to use templates in Django, no need for silly views or templatetags, code your logic where it belongs: In the templates.
For example, the index view from the Django tutorial done the right way:
{% load awesome_templates %}
{% awesome %}
from polls.models import Poll
latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
context['latest_poll_list'] = latest_poll_list
{% endawesome %}
{% if latest_poll_list %}
< ul >
{% for poll in latest_poll_list %}
< li >< a href="/polls/{{ poll.id }}/" >{{ poll.question }}< /a >< /li >
{% endfor %}
< /ul >
{% else %}
< p >No polls are available.< /p >
{% endif %}
Now we can have a way easier view:
from django.shortcuts import render_to_response
def index(request):
return render_to_response('polls/index.html')
Because we don't have to import the models in our view and don't have to instantiate a dictionary for the context, this approach is also a lot faster. And of course it's fully webscale and enterprise ready!
Because this app is so awesome, it does not even require proper documentation or tests.
Enjoy finally being able to use Django the way you should be able to use it!
Product's homepage
Requirements:
· Python
· Django