Make the haiku-generator part of greater nlp app

This commit is contained in:
Tyler Hallada 2015-08-02 22:31:36 -04:00
parent 038843861b
commit dfed18c5ce
3 changed files with 8 additions and 2 deletions

10
app.py
View File

@ -1,13 +1,19 @@
from flask import Flask, render_template from flask import Flask, render_template, redirect
from generate_poem import PoemGenerator from generate_poem import PoemGenerator
app = Flask(__name__) app = Flask(__name__)
generator = PoemGenerator(None) generator = PoemGenerator(None)
@app.route("/") @app.route("/")
def home(): def home():
return redirect('http://git.hallada.net/nlp/')
@app.route("/buzzfeed-haiku-generator")
def buzzfeed_haiku_generator():
haiku = generator.generate_haiku() haiku = generator.generate_haiku()
return render_template('index.html', haiku=haiku) return render_template('buzzfeed-haiku-generator.html', haiku=haiku)
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True) app.run(debug=True)