Not Found Запрошенный URL не найден на сервере. Если вы ввели URL-адрес вручную, проверьте правильность написания и повторите попытку. Это код ошибки.
import os
import csv
from flask import Flask, session, render_template, request
from flask_session import Session
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
app = Flask(__name__)
# Check for environment variable
if not os.getenv("DATABASE_URL"):
raise RuntimeError("DATABASE_URL is not set")
# Configure session to use filesystem
app.config["SESSION_PERMANENT"] = False
app.config["SESSION_TYPE"] = "filesystem"
Session(app)
# Set up database
engine = create_engine(os.getenv("DATABASE_URL"))
db = scoped_session(sessionmaker(bind=engine))
f = open("books.csv")
reader = csv.reader(f)
for isbn, title, author, year in reader:
db.execute("INSERT INTO books (ISBN, title, author, year) VALUES (:ISBN, :title, :author, :year)",
{"ISBN": isbn, "title": title, "author": author, "year": year})
print(f"Added flight from {isbn} to {year} lasting {title} minutes.")
db.commit()
@app.route("/")
def sign_in():
return render_template("Sign.html")
@app.route("/main" method = "post")
def book():
name = request.form.get("name")
return render_template("books.html", username=name)
Кто-нибудь, пожалуйста, помогите мне