Forums

500 sever error

anyone know how to fix it?

Hi there,

Seems like your iornman.pythonanywhere.com is getting to a standard hello world page. Were you able to solve your problem?

no

Hi there, if your website shows a 500 server error, that's usually because of some sort of bug in your code. You should be able to find more information in your error log, which is linked to from the Web tab.

Next time you see a problem, take a look in the error log and see if that provides any clues? And if you're still stuck, post the last few lines of your error log here in the forums?

Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1988, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1641, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1544, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 33, in reraise raise value File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1639, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1625, in dispatch_request return self.view_functionsrule.endpoint File "/home/iornman/mysite/wordGameApp.py", line 26, in display_form challange_word = getWord() File "/home/iornman/mysite/wordGameApp.py", line 89, in getWord random_lines = random.choice(open("sevenUp.txt").readlines()) FileNotFoundError: [Errno 2] No such file or directory: 'sevenUp.txt'

i do have the file?

Try using the full, absolute path to the file, so, eg /home/myusername/myfolder/myfile.txt, not just myfile.txt.

Thank you Harry, that worked!

:-D