irongit

Watch django server with gunicorn and daphne

13 lines445 BPython
1from django.core.management.base import BaseCommand
2from django.core.management import call_command
3from smartwatch.watch import watch_files, start_servers
4
5class Command(BaseCommand):
6 help = 'Starts the file watcher'
7
8 def handle(self, *args, **options):
9 self.stdout.write('Starting file watcher...')
10 call_command('collectstatic', '--noinput')
11 call_command('migrate')
12 start_servers()
13 watch_files()