It looks like you've set up a static file mapping to serve your Python code rather than using the WSGI file. In your JS code, the URL you're accessing is "/static/test.py" plus a query string. Because you have specified /static/
on the static files table and made it point to a directory, you've told the system that when it receives a request for /static/test.py
, it should return the contents of the file test.py
in that directory unchanged.
You should change the URL in your JS code to point to a route that is handled by your Flask app rather than to a static file.