Django, storing HTML code in databases
So I am currently designing a website that I am deploying on Heroku with
Django.
I want to have project pages that I load dynamically using templates
(instead of hard coding various HTML templates) and loading them
dynamically into a div on page load time. These pages are going to be
"project" pages and I am currently thinking of the best way to store them.
I do not think they will be overly similar to each other since I want
different pages to use different HTML, though the general layout will be
similar. I also want to be able to store code sections, much like stack
overflow.
I have 2 ideas on how to store the information:
1) Create a text field and let myself render the HTML tags (since its only
me the admin posting to these pages)
2) Create HTML templates and use a database to store links to the pages so
I can dynamically render a side tab to view the latest and easily archive
them.
What would be the best approach? Any other ideas are welcome as well.
No comments:
Post a Comment