December 11, 2009

How Do You Update Your Content?

Since I moved to Django I've been struggling with the question of how to keep the site's body content up to date. I started out just editing the body pages' HTML, which was stored in the database (crude, but it did allow an earlier transition to Django).

I've since experimented with various mechanisms, including two WYSIWYG editors in the Django admin (not sufficiently expressive) and a full content management system (too cumbersome and tricky to install, though it may become the favored solution eventually). For now I've settled on a scheme that allows me to keep the body page text in the database as either ReStructured Text or raw HTML, but I am sure this is far from the best answer.

So how do you keep your web's textual content up to date without going crazy?

5 comments:

Dougal said...

I use markdown or reStructuredText stored in the DB with a simple Django template tag for outputting them. Reffered to by an alias so I just do something like

{% textblock "home page" markdown %}

Works well for things that are good to update but don't need to update them that often.

swheatley said...

Steve, if you find more information (or have an epiphany outside your blog) on how to deal with this problem, please post an update. I'm looking to spin up a Django site that doesn't need a full-fledged CMS as well and would like to know how other people are managing similar sites.

Doug Napoleone said...

need more time!!!!!

I need to get the rstpages app hosted (basis for the pycon CMS). I think that might work well for you.

In the man time I would recommend the django-wikiapp (also used in pinax) for site content. It supports the major markups, including restructured text. The way the app is written, you can use the controls and pages for full site content, not just a wiki (or multiple wiki's which it also supports).

nathan said...

I just went through this headache for my own low-traffic site. I store the content as restructured text and render it on the fly using django-rstify. If rendering things on the fly becomes too slow I've got plans to render the rest to html and store this in the database when the 'save' button is pressed on the admin page. Then it would just be a matter of displaying this pre-rendered html directly.

My site is static-content heavy with many documents stored as rest. For these I also take advantage of django's template system - rendering the rest to a static html file with something like:

fout = open(htmlpath, 'w')
fout.write(render_to_string('staticdocs.html', payload))

Bill Mill said...

I scp text files to my web server running my custom blog server. Works very well.