We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c17a98f commit aa382e8Copy full SHA for aa382e8
main.py
@@ -3,7 +3,7 @@
3
import os
4
5
from flask import Flask, render_template
6
-import oursql
+import MySQLdb
7
8
app = Flask(__name__)
9
app.debug = True
@@ -25,12 +25,12 @@ def index():
25
f.write(str(hit_count) + '\n')
26
27
# Test database connection
28
- conn = oursql.connect(host='127.0.0.1', user='root', passwd="")
+ conn = MySQLdb.connect(host='localhost', user='root', passwd="")
29
curs = conn.cursor()
30
curs.execute("SELECT 1 + 1")
31
dbresult = curs.fetchone()
32
33
return render_template("index.html", hit_count=hit_count, dbresult=dbresult)
34
35
application = app.wsgi_app
36
-print "Prepared."
+print("Prepared.")
requirements.txt
@@ -1,2 +1,2 @@
1
Flask
2
-oursql
+Flask-MySQLdb
0 commit comments