I have this function to connect to the db sqlite or postgresql when my app start.
def conn_str(self): cfg_rel_path = os.path.join(os.sep, \'pyarchini