mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Launch multiple honcho files depending on the context
This commit is contained in:
@ -1,7 +1,13 @@
|
||||
import atexit
|
||||
import os
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.management.commands.runserver import (
|
||||
Command as Runserver,
|
||||
)
|
||||
from django.utils.autoreload import DJANGO_AUTORELOAD_ENV
|
||||
|
||||
from sith.composer import start_composer, stop_composer
|
||||
from staticfiles.processors import OpenApi
|
||||
|
||||
|
||||
@ -10,4 +16,10 @@ class Command(Runserver):
|
||||
|
||||
def run(self, **options):
|
||||
OpenApi.compile()
|
||||
if (
|
||||
os.environ.get(DJANGO_AUTORELOAD_ENV) is None
|
||||
and settings.PROCFILE_STATIC is not None
|
||||
):
|
||||
start_composer(settings.PROCFILE_STATIC)
|
||||
_ = atexit.register(stop_composer, procfile=settings.PROCFILE_STATIC)
|
||||
super().run(**options)
|
||||
|
Reference in New Issue
Block a user