[Django]-Django Quill Editor Display Saved Field

5👍

The html of the description field can be accessed like this (try in django shell):

Race.objects.all()[0].html

You can for example render all races in an html with the code below.
Note you need to use the ‘safe’ argument in jinja to have the variable interpreted as html code instead of text.

In the views.py:

def show_races(request):
    races_all = Race.objects.all()
    return render(request, "races.html", {"races_all": races_all})

In your races.html:

{% for race in races_all %}
  <h1> {{ race.name }} </h1>
  {{ race.description.html|safe }}
{% endfor %}
👤Simi

3👍

In your template file try

{{ race.description.html | safe }}

Leave a comment