2015-08-03 02:31:36 +00:00
|
|
|
from flask import Flask, render_template, redirect
|
2015-08-02 22:01:16 +00:00
|
|
|
from generate_poem import PoemGenerator
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
generator = PoemGenerator(None)
|
|
|
|
|
2015-08-03 02:31:36 +00:00
|
|
|
|
2015-08-02 22:01:16 +00:00
|
|
|
@app.route("/")
|
|
|
|
def home():
|
2015-08-03 02:31:36 +00:00
|
|
|
return redirect('http://git.hallada.net/nlp/')
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/buzzfeed-haiku-generator")
|
|
|
|
def buzzfeed_haiku_generator():
|
2015-08-02 22:01:16 +00:00
|
|
|
haiku = generator.generate_haiku()
|
2015-08-03 02:31:36 +00:00
|
|
|
return render_template('buzzfeed-haiku-generator.html', haiku=haiku)
|
2015-08-02 22:01:16 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
app.run(debug=True)
|