Dynamic Content Rendering markup with HTML

Hi, I’m working a website which has a blog component. Here is my model:

 title = models.CharField(max_length=500)
    slug = models.SlugField(max_length=200, unique_for_date='publish')
    author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE,)

    content = models.TextField()

    publish = models.DateField(default=timezone.now)
    created = models.DateTimeField(auto_now_add=True)
    updated = models.DateTimeField(auto_now=True)
    status = models.CharField(max_length=10, choices=STATUS_CHOICES, default='draft')

It is up and working, no problem.
I’m having a difficult time figuring out how I can markup the content I enter in the “content” model.
When it renders all of the text is inline and I can’t figure out how to format/add space to the output or how to use HTML to style. My understanding is the content is being dynamically rendered from my database. Is it even possible to mark that content up or do I need to take a different approach? Any feedback on best practices? Not really sure what to do from here.

This is how it’s rendered on the site:

You’ve got a couple of different options.

  • You could implement something like a “Markdown” processor. You would enter the text for the content field as Markdown, and then your view would translate that to HTML to be included in your page.
    This can be considered the general “safe” or “best practices” method.
    You don’t need to specifically use “Markdown”, you could implement any markup language provided you have a method of converting that text to valid html.

  • You could allow for direct entry of HTML in that field, and then render it using either the safe filter, or if you have multiple elements you want to render this way, using the autoescape tag.
    Note: This is not “safe”. Entering incorrect or invalid HTML will break your page.
    This may be ok if you are the only person who is ever going to post content, but is not something you want to do when others are involved.