Make the haiku-generator part of greater nlp app
This commit is contained in:
parent
038843861b
commit
dfed18c5ce
10
app.py
10
app.py
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user