Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting internal server error while running flask app on default route http://127.0.0.1:5000/ #16

Closed
ovaixalee opened this issue Oct 14, 2019 · 1 comment

Comments

@ovaixalee
Copy link

application.py
`import os

from flask import Flask, render_template, request
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker

app = Flask(name)

engine = create_engine("postgresql://postgres:123@localhost:5432/lecture3")
db=scoped_session(sessionmaker(bind=engine))

@app.route("/")
def index():
flights = db.execute("SELECT * FROM flights").fetchall()
return render_template("index.html", flights=flights)

@app.route("/book", methods=["POST"])
def book():
"Book a flight."

name = request.form.get()

if name == 'main':
app.run()
`

@matsui528
Copy link
Owner

this is not related to this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants