Forums

Unable to deploy my flask web project

Hello, a customer with a custom domain $10 per month:I am unable to deploy my flask web project on pythonanywhere platform. The project was previously built with python 3.11.4 but when I subscribed to pythonanywhere platform I observed that P3.11.4 is not supported at the moment but 3.10.5 so I had to downgrade the version of python on my local system to 3.10.5 rebuild the and run the projects and no issue. So I uploaded the file on pythonanywhere, generated requirement text file on the platform then run my web project but I keep getting errors like "No module named flask" when I checked the error log of WSGI. Flask and other modules are installed as I checked the version but i dont know why is not detecting it. Please help. I have been on this for sometime and this is first time of using the platform.

You need to install your packages into the version of Python/virtualenv that your web app is using. Make sure that you are installing them into the correct version of Python/virtualenv. See https://help.pythonanywhere.com/pages/InstallingNewModules/

Thank you it is fine now. I have another question. I want user to be redirected to my domain www.stoda.com when they type stoda.com. When the user types stoda.com it shows permission denied error. I have modified the WSGI config to redirect to www.stoda.com when a user type the url without "www" but it still returns with an error.

See https://help.pythonanywhere.com/pages/NakedDomains/