Forums

changing pythonstartup.py

I registered with pythonanywhere.com just now then created a subdomain where my username prepends .pythonanywhere.com ... all easy enough and I was really encouraged reading up on how many things can be done using the free account!

There's something I'm puzzled about though ... When I edited the default "pythonstartup.py" file resaving it with the following 1 line: print('Hi world!')

I did not see this updated code run at https://grant.pythonanywhere.com/ I'm still seeing the following presented:

Hello, World! This is the default welcome page for a PythonAnywhere hosted web application. Find out more about how to configure your own web application by visiting the web app setup page

Grateful if someone can share some insight into this issue!?

You shouldn't edit .pythonstartup.py script as it's used to run scripts you edit in the editor. If you want to change behavior of the default web app you created, open the wsgi file linked on the Web page and read through it -- it has some commented out templates for different frameworks and setups. Depending on how you want to write your web app, you can choose a particular framework and write your code accordingly. Or you can start with tweaking the exising wsgi file and reloading the Web app to see changes.