Forums

Possible to run scripts from external site, like for form handling?

Is it possible to use PythonAnywhere for individual scripts that can then be called from the HTML/JS projects that I have hosted elsewhere? For example, a form-handling script that returns a set of values based on the input, so the process would be:

  1. User goes to mysite.com and fills out an html form.
  2. On submit, the results are posted to a 'formHandler.py' script hosted on PythonAnywhere.
  3. PythonAnywhere processes the script and thus the results are returned to the html/js page that called it.

Is this possible, or is PythonAnywhere specifically for full projects like django, flask, etc.?

You could either write to a database or an external queue or equivalent. (either do this directly from mysite.com or by hitting say a flask view on pythonanywhere)

and then have the task scheduler to check for new entries to the queue and process it if needed.

if you are looking for it to be real time then maybe you could try embedding pythonanywhere consoles.