I just started working with Django about a week ago and I love it.  I
was able to get my first webapp up and running faster than I have with
various other technologies I've used in the past.

One problem I'm having though is the speed of the template rendering.
That is, the call to render_to_response()

Can someone point me to a site or document that talks about best
practices so I can get the fastest rendering possible?

My app does a bunch of database queries and processing and when I
timed that part, it all completes within 0.5 seconds, but the call to
render_to_response() takes 18 seconds.  Needless to say, the end-user
experience isn't acceptable.

I do have 3 levels of template inheritance.  Would doing away with
that be faster?  I do have a lot of tags in my templates, but I don't
see how I can reduce that without pushing more "display-logic" into my
code which I don't want to do.

I have attached the main template so you can get an idea of how
complex it it.  This extends a template called
"trainingPlansBase.html" which in turn extends "base.html"

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

{% extends "TrainingPlans/trainingPlansBase.html" %} {% load trainingplan_extras %} {% block mainContent %}

{{ plan.name }}

{{ plan.description }}

Change Week Display
Week Starts On: {% spaceless %} {% for c in DOW_CHOICES %} {{ c.1 }} {% endfor %} {% endspaceless %}
Plan Starts On: {% spaceless %} {% for c in DOW_CHOICES %} {{ c.1 }} {% endfor %} {% endspaceless %}
  
Create Schedule With Dates
Plan Ends On:
Week Starts On: {% spaceless %} {% for c in DOW_CHOICES %} {{ c.1 }} {% endfor %} {% endspaceless %}
{% if planEndDate %} {% for workoutWeek in workoutWeeks %}{% spaceless %} {% spaceless %} {% if workoutWeek.weekStartDate %} {% else %} {% endif %} {% for workoutDay in workoutWeek.workouts %} {% endfor %} {% endspaceless %} {% endspaceless %}{% endfor %}
Week Of {% else %} Week {% endif %} {{ dowHeading.0 }} {{ dowHeading.1 }} {{ dowHeading.2 }} {{ dowHeading.3 }} {{ dowHeading.4 }} {{ dowHeading.5 }} {{ dowHeading.6 }} TOTAL
{{ workoutWeek.weekStartDate }}{{ workoutWeek.weekNumber }}{% spaceless %} {% if workoutDay %} {% for workout in workoutDay %} {% ifnotequal forloop.counter0 0 %}
{% endifnotequal %} {% if workout.fullDescription %} {{ workout.shortDescription }} {% else %} {{ workout.shortDescription }} {% endif %} {% endfor %} {% else %}   {% endif %} {% endspaceless %}
{{ workoutWeek.weekMiles }} Mi
{% endblock %}

Reply via email to