From 57c46eff8a61a56658242306d139e86b84f01f5d Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 27 Nov 2015 10:16:06 +0200 Subject: Added self update --- servo/management/commands/selfupdate.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 servo/management/commands/selfupdate.py (limited to 'servo/management') diff --git a/servo/management/commands/selfupdate.py b/servo/management/commands/selfupdate.py new file mode 100644 index 0000000..d985041 --- /dev/null +++ b/servo/management/commands/selfupdate.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- + +import os.path +from subprocess import call +from django.conf import settings +from django.core.management.base import BaseCommand + + +class Command(BaseCommand): + + help = "Updates this Servo installation" + + def handle(self, *args, **options): + mc = os.path.join(settings.BASE_DIR, 'manage.py') + call(['git', 'pull', 'origin', 'master']) + call([mc, 'migrate', '--no-initial-data']) + call([mc, 'clearsessions']) -- cgit v1.2.3