Rectangle 27 0

If you set the SERVER_NAME config value, it must match the host and port that the app is being externally served on. Either comment it out, or make it match the domain or ip of the server.


python - Flask App only returns 404's regardless of how it is run - St...

python nginx flask uwsgi
Rectangle 27 0

PythonAnywhere dev here -- you don't need a on PythonAnywhere. The code that normally goes in there is to run a local Flask server that can serve your app -- that's all handled for you by our system.

Instead, you need to change the WSGI file (linked from the "Web" tab) to import the appropriate application module. So, because the sample site you have on github does

from app import app

...on PythonAnywhere in the WSGI file you'll need to do this:

from app import app as application

One thing to be aware of -- if I'm understanding your file listings above correctly, you don't have all of the github app installed -- only the templates. You'll need,, and, and they'll need to be in the same directory structure as the original.

Thank you, changing the WSGI file and keeping the original directory structure worked!!! Kudos to pythonanywhere, it made web deployment much easier than it was !!!

python - Deploying flask site/application on - Stac...

python flask web-deployment pythonanywhere
Rectangle 27 0

As soon as you return a value, and complete the request, FastCGI is going to clean up after you, and that means all the threads you spawned. If you really NEED your task to go on ticking, you have to use multiprocessing so that the process you spawned can survive the end of the request.

i dont think subprocess works unless i write another standalone script. i agree on celery. but i think the right answer is actually multiprocesses

You're right, I was confusing the two. Multiprocessing is what you need.

python - How do I run background threads after the request has been re...

python django nginx flask flup