Forums

HELP please, even "hello wold" dont work on pythonanywhere!

Hello, i maked new project "mysite", then i write in console "python manage.py startapp mysite1", it created new folder "mysite1" in "mysite". i make new file hello.py (its work in console), i put this file to "mysite" and "mysite/mysite1". Then i try reload my url, but it say again: "Of course, you haven't actually done any work yet. Next, start your first app by running python manage.py startapp [app_label]."

i try run http://orealdream.pythonanywhere.com, http://orealdream.pythonanywhere.com/mysite, http://orealdream.pythonanywhere.com/mysite1, http://orealdream.pythonanywhere.com/mysite/mysite1, http://orealdream.pythonanywhere.com/hello.py, http://orealdream.pythonanywhere.com/mysite/mysite1/hello.py, http://orealdream.pythonanywhere.com/mysite/hello.py, http://orealdream.pythonanywhere.com/mysite1/hello.py

All urls dont work, except url http://orealdream.pythonanywhere.com/static/hello.py (i copy my file to this folder too), but its showed like text, python dont work!

How to run in browser "hello world" on pythonanywhere?

If you were expecting http://orealdream.pythonanywhere.com/mysite/hello.py to run your script at mysite/hello.py, then you have misunderstood how django works. Your django app actually does a bunch of stuff (and doesn't directly run files according to their path like a CGI server- that tends to lead to security loopholes. I would suggest reading through the django docs or tutorial to understand their MVC model.

Alternatively, if you are looking for something more simplistic, you could read up on flask.