HTML nicht die Darstellung in Django-text-Feld

Ich bin versucht zu verwenden markdown zu vermeiden, geben Sie HTML in meine wiki-form, aber für einige Grund der form ist die Darstellung von HTML-code anstelle der beabsichtigten Formatierung.

Meine view-Funktion ist wie folgt:

from django.shortcuts import render_to_response
from mywiki.wiki.models import Page
from django.http import HttpResponseRedirect
import markdown


def view_page(request, page_name):
    try:
        page = Page.objects.get(pk=page_name)
    except Page.DoesNotExist:
        return render_to_response('create.html', {'page_name':page_name})

    content = page.content    
    return render_to_response('view.html', {'page_name':page_name, 'content':markdown.markdown(content)})

Dies ist mein view.html Vorlage:

{% extends 'base.html' %}
{% load wikilink %}

{% block title %}{{page_name}}{% endblock %}

{% block content %}
        <h1>{{page_name}}</h1>
        {{content|wikify}}
        <hr/>
        <a href='/mywiki/{{page_name}}/edit/'>Edit this page?</a>

{% endblock %}

- Und das ist meine base.html:

<html>
    <head>
        <title>{{% block title %}{% endblock %}</title>
    </head>
    <body>
<div>
Menu: <a href='/mywiki/Start/'>Start Page</a>
</div>
        {% block content %}
        {% endblock %}
    </body>
</html>

Ich habe markdown installiert, und mein Django-version 1.4.1 (Mac).

Dank.

InformationsquelleAutor entrepaul | 2012-09-13
Schreibe einen Kommentar