Skip to content

Instantly share code, notes, and snippets.

@rolo
Created August 8, 2013 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolo/6184882 to your computer and use it in GitHub Desktop.
Save rolo/6184882 to your computer and use it in GitHub Desktop.
Automatically republish all Django CMS 2.4.2 pages which are already published. For when all pages needed republishing after an upgrade from 2.3.x.
from cms.models.pagemodel import Page
pages = Page.objects.filter(published=True, publisher_is_draft=True)
for page in pages:
print '%s (%d)' % (page, page.id)
page.publish()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment