From 4ba62574a2743fa30eb925708cfec3b2c0eedde9 Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Thu, 7 Aug 2014 18:22:09 +0200 Subject: [PATCH] Flask has its own request module, we don't need python-requests --- config.py.sample | 2 ++ requirements.txt | 1 - tekstmelding.py | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config.py.sample b/config.py.sample index 4889484..d809c31 100644 --- a/config.py.sample +++ b/config.py.sample @@ -1,3 +1,5 @@ +DEBUG = True + DATABASE_HOST = 'localhost' DATABASE_USER = 'inside' DATABASE_PASS = '' diff --git a/requirements.txt b/requirements.txt index c8f5482..42dea51 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ Flask==0.10.1 -requests==2.3.0 MySQL-python==1.2.5 diff --git a/tekstmelding.py b/tekstmelding.py index e281b9f..6689d74 100644 --- a/tekstmelding.py +++ b/tekstmelding.py @@ -1,4 +1,4 @@ -from flask import Flask +from flask import Flask, request import MySQLdb import MySQLdb.cursors import datetime @@ -18,7 +18,12 @@ app = Flask(__name__) @app.route('/') def main(): - return 'Tekstmelding er bezt!' + return 'Tekstmelding er bezt!' + +@app.route('/callback') +def callack(): + return 'Callback liksom.' if __name__ == '__main__': - app.run() + app.debug = config.DEBUG + app.run()