Permalink
Browse files

Load data in setup_all. Changelog.

  • Loading branch information...
1 parent a4ba571 commit 884976241c094bbc08c3d2f546026b832a65810e @philipn philipn committed Nov 28, 2011
Showing with 18 additions and 3 deletions.
  1. +9 −0 CHANGELOG
  2. +0 −3 deb_utils/localwiki.postinst
  3. +9 −0 sapling/utils/management/commands/setup_all.py
View
9 CHANGELOG
@@ -0,0 +1,9 @@
+=============================
+LocalWiki changelog
+=============================
+
+
+Version 0.2, 2011-11-28
+-----------------------------
+
+Initial public-facing release.
View
3 deb_utils/localwiki.postinst
@@ -35,9 +35,6 @@ case "$1" in
# If first time setup, initialize site and wiki
if [ ! -d "$datadir/deploy" ]; then
- echo "Adding default pages ..."
- localwiki-manage loaddata basic_pages
-
echo "Configuring apache ..."
mkdir "$datadir/deploy"
cp "$confdir/localwiki.wsgi.template" "$datadir/deploy/localwiki.wsgi"
View
9 sapling/utils/management/commands/setup_all.py
@@ -2,6 +2,11 @@
from django.core.management import call_command
+def has_pages():
+ from pages.models import Page
+ return Page.objects.all()
+
+
class Command(BaseCommand):
help = ('Sets up the localwiki install. '
'Only run this command on a fresh install.')
@@ -11,3 +16,7 @@ def handle(self, *args, **options):
call_command('migrate', verbosity=0)
call_command('collectstatic', interactive=False, verbosity=0)
call_command('reset_permissions', verbosity=0)
+
+ if not has_pages():
+ print "Adding basic pages.."
+ call_command('loaddata', 'basic_pages')

0 comments on commit 8849762

Please sign in to comment.