Django form to enter/save html to database

Posted by Ian on Stack Overflow See other posts from Stack Overflow or by Ian
Published on 2010-06-16T22:59:37Z Indexed on 2010/06/16 23:02 UTC
Read the original article Hit count: 188

Filed under:

I'm in my first week of Django development and am working on an admin page that will let me write some quick html using TinyMCE and then save it to the database. I don't need to display this web page on the site or add it to urls.py, etc. The html snippet will be loaded from the database and used in a view function.

I've read in "Practical Django Projects" how to integrate TinyMCE, so my question is more concerned with the best approach for the form itself. Specifically:

1. Is there a built-in form like flatpage that works well for this? I only need one field in the form for the html.

2. How do I save the form's text after it's entered?

I created a model with a JSONField to save the html in, but I'm not clear on what to do next. Thanks.

© Stack Overflow or respective owner

Related posts about django