-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement runserver_with_q command to start Django Q alongside …
…the server
- Loading branch information
1 parent
19ea774
commit 33fafa0
Showing
3 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import multiprocessing | ||
import os | ||
|
||
from django.core.management import call_command | ||
from django.core.management.commands.runserver import Command as RunserverCommand | ||
|
||
|
||
class Command(RunserverCommand): | ||
def handle(self, *args, **options): | ||
multiprocessing.Process(target=self.start_django_q).start() | ||
|
||
super().handle(*args, **options) | ||
|
||
def start_django_q(self): | ||
call_command("qcluster") |