I'm a bit new to web development and am having trouble understanding how site content is stored. Even after looking at open source projects, I am still confused.
Lets say that I have a web page with multiple paragraphs that I am hoping to eventually be able to edit through the Django admin page. Now, I have the view set up for the page but I am unsure as how the models should be structured.
So far I have:
from django.db import models
class content(models.Model):
name = models.CharField(max_length=30)
last_updated = models.DateField(blank=True,null=True)
content = models.TextField()
'name' is what my paragraphs will be talking about and 'content' should be all the paragraphs on that page. My question: Should the content field be stored in HTML or should I just store purely text? If it is pure text, how will I be able to add the HTML formatting when I embed the model.content field into my template? Wouldn't this be difficult see as I would need to parse the pure text to do so?
However, if I store HTML in the content field, wouldn't I have to use HTML when entering content or use a WYSIWYG editor in the admin page?
Thank you for any help :)