Add management command to perform steps required after an upgrade.

This commit is contained in:
Roberto Rosario
2015-07-18 02:24:10 -04:00
parent afe6644321
commit a5cf80cd86
5 changed files with 29 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
from __future__ import unicode_literals
from django.core import management
from ...signals import perform_upgrade
class Command(management.BaseCommand):
help = 'Performs the required steps after a version upgrade.'
def handle(self, *args, **options):
management.call_command('migrate', interactive=False)
management.call_command('purgeperiodictasks', interactive=False)
perform_upgrade.send(sender=self)

View File

@@ -3,3 +3,4 @@ from __future__ import unicode_literals
from django.dispatch import Signal
post_initial_setup = Signal(use_caching=True)
perform_upgrade = Signal(use_caching=True)