Forums

Django webdev server running, but not loading in browser

I'm following How to Tango with Django verbatim but have hit the mentioned problem. If you have the book I'm stuck in section 3.2. The server runs on 127.0.0.1:8006 but nothing loads when I put that address in my url bar.

There is another funny thing happening: I cannot start servers on localhost port 8000 or 8001, but I am pretty sure I have no processes running. I have tried in bash fg to check for background processes but recieve bash: fg: current: no such job . Additionally lsof -i:8000 produced command not found .

How can I find and kill whatever processes are running in my ports, and load this damn server?!

Thanks for your time, have a puppy.

And a very handsome puppy that is too!

Are you trying to run the server on PythonAnywhere? Or on your own machine?

giles,

I think I am running the server on PythonAnywhere? I initialize the server through a console here on PA.

also,

all the files and directories i am running are contained within PA

That's because the run server stuff (basically only used for local development) does not work on PythonAnywhere. Instead, if you need to create a webapp on the PythonAnywhere and point your wsgi file at your source code, and we will run your code on our servers for you. Are you following this?

facepalm I am in chapter 3 using version 1.9 of the book. I had incorrectly assumed to use PA since the chapter mentioned it, but it did not explicitly say to do do. I hope to try this entirely on my machine later

Aha! That would be the problem. If you want to follow the tutorial strictly then I think yes, you do need to do the initial stuff on your own machine, and only later upload to PythonAnywhere. That was certainly the case with the earlier versions, anyway.

It is possible to do everything on PythonAnywhere, of course, but that might require too many changes to make the tutorial easy to follow.