If your view puts the source code in a context variable called source, your template might look like this:
<pre>
{{ source|escape }}
</pre>
The escape filter will escape certain characters to make sure the HTML is rendered correctly.
If you just want to display hard coded template source in your template, there are two options.
Use HTML escaping to do so and remove your XMP tags.
{ instead of }
} instead of {
Or use the templatetag template tag:
{% templatetag openbrace %} instead of }
{% templatetag closebrace %} instead of {
etc.. refer to link