Forums

Unable to open database file

I keep getting this error:

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file

This is the code that I use to connect the database:

app = Flask(__name__)
app.config['SECRET_KEY'] = 'XXXXXXXXXXXX'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://./footballDB.db'
db = SQLAlchemy(app)
bcrypt = Bcrypt(app)
login_manager = LoginManager(app)
login_manager.login_view = 'login'

Try with an absolute path for the database file