Django devserver load once

I am trying to develop a django application it use paddelocr take sometime to initiate. so when ever I am trying to change something and test it I have to wait 5 sec for the paddleocr to initiate again. Is there a way to load the model only once when i start the dev server and not everytime I make some changes.

I have tried adding the model initalization in the setting.py assuming that it will only run only that didn't work. I have also tried one of gpts suggestion of using thread but no luck so far

Вернуться на верх