Fix flask dependency python function in javascript