2015-11-18 09:44:06 +01:00
|
|
|
#!/usr/bin/env python3
|
2017-04-24 17:51:12 +02:00
|
|
|
#
|
2023-04-04 18:39:45 +02:00
|
|
|
# Copyright 2023 © AE UTBM
|
|
|
|
# ae@utbm.fr / ae.info@utbm.fr
|
2017-04-24 17:51:12 +02:00
|
|
|
#
|
2023-04-04 18:39:45 +02:00
|
|
|
# This file is part of the website of the UTBM Student Association (AE UTBM),
|
|
|
|
# https://ae.utbm.fr.
|
2017-04-24 17:51:12 +02:00
|
|
|
#
|
2024-09-23 01:37:25 +02:00
|
|
|
# You can find the source code of the website at https://github.com/ae-utbm/sith
|
2017-04-24 17:51:12 +02:00
|
|
|
#
|
2023-04-04 18:39:45 +02:00
|
|
|
# LICENSED UNDER THE GNU GENERAL PUBLIC LICENSE VERSION 3 (GPLv3)
|
2024-09-23 10:25:27 +02:00
|
|
|
# SEE : https://raw.githubusercontent.com/ae-utbm/sith/master/LICENSE
|
2023-04-04 18:39:45 +02:00
|
|
|
# OR WITHIN THE LOCAL FILE "LICENSE"
|
2017-04-24 17:51:12 +02:00
|
|
|
#
|
|
|
|
#
|
2025-02-26 10:42:11 +01:00
|
|
|
import atexit
|
|
|
|
import logging
|
2015-11-18 09:44:06 +01:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2025-02-17 15:58:53 +01:00
|
|
|
from django.utils.autoreload import DJANGO_AUTORELOAD_ENV
|
|
|
|
|
2025-02-20 18:38:15 +01:00
|
|
|
from sith.composer import start_composer, stop_composer
|
2025-03-04 14:48:44 +01:00
|
|
|
from sith.settings import PROCFILE_SERVICE
|
2025-02-17 15:58:53 +01:00
|
|
|
|
2015-11-18 09:44:06 +01:00
|
|
|
if __name__ == "__main__":
|
2025-02-26 10:42:11 +01:00
|
|
|
logging.basicConfig(encoding="utf-8", level=logging.INFO)
|
|
|
|
|
2015-11-18 09:44:06 +01:00
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sith.settings")
|
|
|
|
|
|
|
|
from django.core.management import execute_from_command_line
|
|
|
|
|
2025-03-04 14:48:44 +01:00
|
|
|
if os.environ.get(DJANGO_AUTORELOAD_ENV) is None and PROCFILE_SERVICE is not None:
|
|
|
|
start_composer(PROCFILE_SERVICE)
|
|
|
|
_ = atexit.register(stop_composer, procfile=PROCFILE_SERVICE)
|
2025-02-17 15:58:53 +01:00
|
|
|
|
2015-11-18 09:44:06 +01:00
|
|
|
execute_from_command_line(sys.argv)
|