Answer the question
In order to leave comments, you need to log in
Why does Django ORM not have time to update the connector in multithreading on HDD?
I ran into a problem that on HDD Django ORM does not have time to update the connector in a parallel project in which I connected the connection to the database through Django ORM
import django
SITE_PATH = os.path.abspath(os.path.dirname(__file__))
PROJECT_PATH = os.path.normpath(os.path.join(SITE_PATH, '..'))
SRC_PATH = os.path.join(PROJECT_PATH, 'api')
if SRC_PATH not in sys.path:
sys.path.insert(0, SRC_PATH)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings")
django.setup()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question