Search code examples
djangodjango-flatpages

Using Django Flatpages in production: how to archive changes for recovery purposes


I am using Django Flatpages in a production site. I'd like to figure out the best way to make sure if an admin makes a mistake editing a file, old version of the page can be retrieved. We have backups and such, but that's a bit more cumbersome to recover from (i.e. involves sysadmin, not website editor).

First, is there a package that does this? I don't need something that archives all db changes to the filesystem or MongelDB, but perhaps a Flatpages add-on.

If not, I came up with two alternatives:

  1. Just have a staging server where all the live changes happen, then load on production

    Django flatpages backup?

  2. Some external script that monitors DB, and upon seeing changes to Flatpages contents, save a copy of the latest content in some other table, like FlatpagesHistory. Then website editor can just use Admin service to retrieve old copies of the pages from FlatpagesHistory. Has anyone done this?

I appreciate your feedback.

Thanks.


Solution

  • Try django-reversion https://github.com/etianen/django-reversion