Forums

Problems starting out with Flask

Yep, another one of those... ;)

So, I'm starting over on the FlaskTaskr blog tutorial from RealPython.com... trying to figure out how to make it work on pythonanywhere.com

I've pushed the code so far (pg 135) to my github repo, so if anyone wants to look at the files and tell me what I messed up, feel free.

I'm guessing its either in the pythonanywhere.com wsgi.py config file:

import os
import sys

path = '/home/memilanuk/mysite/flasktaskr2/project/'
if path not in sys.path:
    sys.path.append(path)

from views import app as application

I'm using a virtualenv as described in the PA wiki, which is installed at /home/memilanuk/.virtualenvs/flasktaskr2/.

I've looked at the PA wiki page for Flask as well, and I'm still not sure I have things setup right in the wsgi.py file. I've tried both run.py with if __name__ == "__main__": to keep app.run() from interfering with the pythonanywhere wsgi server, and just calling the app file views.py directly as shown in the code example above.

Any assistance would be greatly appreciated.

Monte

Are there any clues in the error log? It's linked from the web tab

I did find a few problems in the error log (is there any way to truncate that file?) and got it working... and since then broke it again for other reasons ;)

Excellent, some forward progress then :-) Let us know if you hit any other problems you can't solve on your own.

The error log gets rotated every day, so long as it's got more than a few kbytes in it. Adding a "clear now" button is on our to-do list, I've added an upvote on your behalf.