Skip to content

Commit aa382e8

Browse files
committed
Update to Python 3
1 parent c17a98f commit aa382e8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44

55
from flask import Flask, render_template
6-
import oursql
6+
import MySQLdb
77

88
app = Flask(__name__)
99
app.debug = True
@@ -25,12 +25,12 @@ def index():
2525
f.write(str(hit_count) + '\n')
2626

2727
# Test database connection
28-
conn = oursql.connect(host='127.0.0.1', user='root', passwd="")
28+
conn = MySQLdb.connect(host='localhost', user='root', passwd="")
2929
curs = conn.cursor()
3030
curs.execute("SELECT 1 + 1")
3131
dbresult = curs.fetchone()
3232

3333
return render_template("index.html", hit_count=hit_count, dbresult=dbresult)
3434

3535
application = app.wsgi_app
36-
print "Prepared."
36+
print("Prepared.")

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Flask
2-
oursql
2+
Flask-MySQLdb

0 commit comments

Comments
 (0)