Forums

Cannot import name CSRFProtect on flask project

Hello, I just deployed my first flask project. In my local dev environment it works as expected, however on pythonanywhere I get the error in the title. If I manually run the import in the python console it works without issue.

Any ideas what this could be?

Thank you!

It looks like your web app is using a virtualenv. Have you installed the Flask-WTF module into it? If so, have you restarted the web app (using the green button on the "Web" tab) since you installed the module?

Thank you so much for the fast reply! I did in fact install the module (and even reinstall it), but I did not reload the app. It works as expected now, many thanks!

Excellent, thanks for confirming!