Putting up on mule, apache2 mod_wsgi

This commit is contained in:
Tyler Hallada 2015-08-02 22:09:36 -04:00
parent e7b0d09b46
commit 038843861b
4 changed files with 24 additions and 3 deletions

0
__init__.py Normal file
View File

8
buzzfeed-haiku-generator.wsgi Executable file
View File

@ -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

View File

@ -32,7 +32,7 @@ class PoemGenerator():
self.words = [] self.words = []
self.all_words = [] self.all_words = []
self.inflect_engine = inflect.engine() 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=',') reader = csv.reader(statuses, delimiter=',')
for row in reader: for row in reader:
if 'via buzzfeed ' not in row[1].lower(): # only English if 'via buzzfeed ' not in row[1].lower(): # only English

View File

@ -1,10 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Buzzfeed Haiku Generator</title> <title>BuzzFeed Haiku Generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
text-align: center;
}
div.haiku pre {
font-size: large;
}
div.footer {
font-size: small;
margin-top: 50px;
}
</style>
</head> </head>
<body> <body>
<h1>Buzzfeed Haiku Generator</h1> <h2>BuzzFeed Haiku Generator</h2>
<div class="haiku"> <div class="haiku">
<pre>{{haiku}}</pre> <pre>{{haiku}}</pre>
<form action=""> <form action="">