ytsm/YtManagerApp/apps.py

14 lines
444 B
Python
Raw Normal View History

2018-10-04 11:36:11 +00:00
from django.apps import AppConfig
2018-10-10 22:43:50 +00:00
import os
2018-10-04 11:36:11 +00:00
class YtManagerAppConfig(AppConfig):
2018-10-04 11:36:11 +00:00
name = 'YtManagerApp'
def ready(self):
2018-10-10 22:43:50 +00:00
# There seems to be a problem related to the auto-reload functionality where ready() is called twice
# (in different processes). This seems like a good enough workaround (other than --noreload).
if not os.getenv('RUN_MAIN', False):
from .appmain import main
main()