From 038843861be6817230f4c3b8f5537454d6960f1b Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Sun, 2 Aug 2015 22:09:36 -0400 Subject: [PATCH] Putting up on mule, apache2 mod_wsgi --- __init__.py | 0 buzzfeed-haiku-generator.wsgi | 8 ++++++++ generate_poem.py | 2 +- templates/index.html | 17 +++++++++++++++-- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 __init__.py create mode 100755 buzzfeed-haiku-generator.wsgi diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/buzzfeed-haiku-generator.wsgi b/buzzfeed-haiku-generator.wsgi new file mode 100755 index 0000000..e37af5c --- /dev/null +++ b/buzzfeed-haiku-generator.wsgi @@ -0,0 +1,8 @@ +import os +import sys +sys.path.append('/var/www/buzzfeed-haiku-generator') + +import logging +logging.basicConfig(stream=sys.stderr) + +from app import app as application diff --git a/generate_poem.py b/generate_poem.py index fa2e773..62935d0 100644 --- a/generate_poem.py +++ b/generate_poem.py @@ -32,7 +32,7 @@ class PoemGenerator(): self.words = [] self.all_words = [] self.inflect_engine = inflect.engine() - with open('buzzfeed_facebook_statuses.csv', newline='') as statuses: + with open('/var/www/buzzfeed-haiku-generator/buzzfeed_facebook_statuses.csv', newline='', encoding='utf-8') as statuses: reader = csv.reader(statuses, delimiter=',') for row in reader: if 'via buzzfeed ' not in row[1].lower(): # only English diff --git a/templates/index.html b/templates/index.html index 974d0eb..e6cd30e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,10 +1,23 @@ - Buzzfeed Haiku Generator + BuzzFeed Haiku Generator + + -

Buzzfeed Haiku Generator

+

BuzzFeed Haiku Generator

{{haiku}}