Hi,

I need to serve .xml files but the HTTP-Header Content-Type is HTML/Text.
How do i change this?

My code in the view looks like:

def countries(request):
    country_list = Countries.objects.all().order_by('name')
    return render_to_response('geo/countries.xml', {'country_list':
country_list})

and the template:

{% extends "base.xml" %}
{% block content %}
        {% if country_list %}
                {% for c in country_list %}
        <item name="{{c.name}}">
                <formal>{{c.formal_name}}</formal>
        </item>
                {% endfor %}
        {% else %}
        No countries found in DB
        {% endif %}
{% endblock %}


PS. Is there a way to get rid of all the white space in the final HTML/XML
files that get served to the client?




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to