Spaces:
Runtime error
Runtime error
File size: 484 Bytes
3de94d7 332e32d 3de94d7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from flask import Flask, request
import sqlite3
app = Flask(__name__)
@app.route('/', methods=["GET","POST"])
def get_data():
message = "ERRO"
try:
conn = sqlite3.connect("govDatabase3.db")
sql_query = """INSERT INTO CNAES (`CÓDIGO`, `DESCRIÇÃO`) VALUES (10, "descrição 1");"""
cursor = conn.execute(sql_query)
cursor.fetchall()
message = "CERTO!"
except Exception as err: message = str(err)
return {"message": message} |