My site is at http://jddunn.pythonanywhere.com/. The app gets responses from files in the dir, but I'm running into an issue with getting the text file data. Here's how I'm pointing to my files (my site needs to grab data from a pickle file and text files in the app folder).
self.brain_path = "string_of_folder_name"
dir = os.path.abspath(os.path.dirname(__file__))
path = os.path.join(dir, 'data', self.brain_path, 'texts_all.txt')
with open(path) as f:
texts_all['all'] = [tuple(re.split(r'\t+', line.strip())) for line in f.readlines()]
I have this wrapped up in a try / except statement, and am getting an error.
I have printed a check statement to see if the file was gotten after being opened, and it does print out the information: "<_io.TextIOWrapper name='/home/jddunn/emoter/data/string_of_folder_name/texts_all.txt' mode='r' encoding='UTF-8'>"
This code and app runs just fine running locally on my Windows computer.
Here's the error I get in the access log.
"POST /chat HTTP/1.1" 500 291 "http://jddunn.pythonanywhere.com/" "Mozilla/5.0 (Windows NT 10.0; WOW64)
My server log just ends at the last line in the code sample above. I really don't know what else to try from here; I've tried looking at threads but I haven't gotten to a solution.
Can anyone help me please? I am trying to get this ready for a show today, and will be unable to run it locally on a computer (which is what I planned).