Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Load data in setup_all. Changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
philipn committed Nov 28, 2011
1 parent a4ba571 commit 8849762
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=============================
LocalWiki changelog
=============================


Version 0.2, 2011-11-28
-----------------------------

Initial public-facing release.
3 changes: 0 additions & 3 deletions deb_utils/localwiki.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions sapling/utils/management/commands/setup_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand All @@ -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.