I have a flask app which uses a json file to store some config data. That .json file stores at the same location(directory) as the flask app file(app.py) is located. This flask app works fine in the local machine. But when I deploy to a live server (Ubuntu VPS), I'm getting a WSGI error says that
FileNotFoundError: [Errno 2] No such file or directory: 'config.json'
my code is for the .json file as follows
from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
import json
import random
with open('config.json', 'r') as c:
par = json.load(c)["par"]
What is the wrong with this and how to fix ?