Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# https://github.com/django/asgiref/issues/179
from asgiref.sync import SyncToAsync
old_init = SyncToAsync.__init__
def _thread_sensitive_init(self, func, thread_sensitive=True):
return old_init(self, func, thread_sensitive=True)
SyncToAsync.__init__ = _thread_sensitive_init
import json
import logging
import django.core.management
import django.conf
import os
import sys
from sys import argv
from collections import OrderedDict, defaultdict
from pathlib import Path
from typing import Optional
# avoid confusion with otree_startup.settings
from django.conf import settings as django_settings
from importlib import import_module
from django.core.management import get_commands, load_command_class
# https://github.com/django/asgiref/issues/179
from asgiref.sync import SyncToAsync
old_init = SyncToAsync.__init__
def _thread_sensitive_init(self, func, thread_sensitive=True):
return old_init(self, func, thread_sensitive=True)
SyncToAsync.__init__ = _thread_sensitive_init
import json
import logging
import django.core.management
import django.conf
import os
import sys
from sys import argv
from collections import OrderedDict, defaultdict