Forums

The requested resource was not found on this server

Hi, I am a total noob to Django and using pythonanywhere. All I want to do is to access and run a python 3.7 script from pythonanywhere. So, what I did was to start a new Django project on pythonanywhere. I set debug to false in the settings.py and then I uploaded an index.php and the py-file that the php is supposed to load to what I believe is the home directory of my web app. This doesn't work. I just get: "The requested resource was not found on this server" when I try to load it.

Am I doing anything right here? :)

There is no way to serve php on PythonAnywhere.

Thanks for the reply! Well, I don't need to use PHP, in my ignorance I thought it was mandatory for running .py on any webserver. So, if I rephrase my question: How do I access my .py file from my pythonanywhere site?

It depends on what actually you want to do. Do you want to trigger some actions through your web app interface? Or do you want to have a script running and have access to some data it's returning?

Hmmm... Well, it's an automation project that I'm involved in. The goal is to somehow automate updates of entities/cells on an Autodesk Shotgrid site. So, the current idea is to trigger an action from the Shotgrid site. It has a built-in function for triggering external scripts from custom menu items on the site. So, since I need to put the python script externally from the Shotgrid site I looked for places to host a script while developing it. That's when I found pythonanywhere.

So I basically just want to trigger the script and the script then does its thing with the Shotgrid site via an API. So the first alternative I suppose. :)

Take a look at https://blog.pythonanywhere.com/169/

Ah, thanks, Flask looks easier to grasp than Django. I'll try Flask instead. :)