I am new to python and programming in general. This bit of code will eventually be used in a larger application. I apologize ahead of time for any mistakes. I am trying to make a simple query from a table in a postgresql database. The only result comes back as None. Even though I know there is data there. Thank you in advance for any assistance.
import psycopg2
def connect():
"""Connects to the database so you can query the stats you require"""
conn= psycopg2.connect("dbname='Nascar_Stats' user='postgres' \
host='localhost' password='xxxxxxxx'")
print('Connected to DB')
cur = conn.cursor()
cur.execute("SELECT 'Track_Length' FROM t_tracks \
WHERE 'Track_ID' = 'Daytona';")
length = cur.fetchone()
print('Track Length = ', length)
conn.close()