Hi everybody,
Since yesterday I have an error I can not resolve... I want to do a web app using Flask and a database in sqlite3. So I have imported all the files that I need, and now I have something like that:
\mysite\
flask_app.py
data\
myDataBase.db
In flask_app.py I just do a simple code but every time I try to execute a sql statement, I have an Error 500, Internal server error... My flask_app.py look just like that:
from flask import Flask
import sqlite3
app = Flask(__name__)
@app.route('/')
def hello_world():
conn=sqlite3.connect('/home/Camille/mysite/data/myDataBase.db')
cursor=conn.cursor()
select="SELECT * FROM Repas"
cursor.execute(select)
test=cursor.fetchone()
return test
conn.close()
cursor.close()
When I run the app with a console, everything work finem I can access my data base. But at <username>.pythonanywhere.com, I got internal server error. When I am not using the database I can access the web page.
If anyone know what I am doing wrong, please help me! Thanks a lot