[Answered ]-Help with writing a custom CMS in Django

2👍

  1. Storing HTML tags is not inherently unsafe. You just have to scrub them of dangerous content before putting them in the database.

  2. Your page model will need to include information about the category. Then when displaying a category, you’ll query your pages by category to get all the “computer” pages to display on the computer page.

0👍

Do split this in 2 separate questions in the future.

  1. Storing HTML is fine. When you output it be sure to use |safe in the templates. If you really want to be picky, you can avoid storing by using http://en.wikipedia.org/wiki/Textile_%28markup_language%29 or http://en.wikipedia.org/wiki/Markdown. They are wysiwig editors out there that do all your trouble.

  2. You can create a Category model and all your pages with have a ForeignKey to this model. One of the most flexible solutions I found was to use tags, so a page can have multiple tags and thus fall under multiple ‘categories’ http://code.google.com/p/django-tagging/

Hope this helps.

👤Tudor

Leave a comment