Forums

A doubt of running server in console

After I created a web app in 'Web' tab and configured WSGI file, the server is prepared for use without running any command in console. Then if I run 'python manager.py runserver' in the web console, what does that mean? Does that mean the latter console server would override the default server when I created web app? Sorry if this is a silly question. Thanks.

I am not sure if this is exactly correct but here it goes. When you use the wsgi file, you can access your website at your_username.pythonanywhere.com. On the other had, if you use runserver, your web app will also be available at localhost(127.0.blah.blah:d'oh) and will be served by Django's development server instead of whatever web server pythonanywhere uses. Again, I could be wrong.

Edit: Now that I actually read my post, I think I am definitely wrong :). Could someone help us out here?

Edit again: This was already answered here.

The short answer is that the Django runserver isn't supported on PythonAnywhere. It's really only designed for running on a local machine -- while I'm not aware of any security problems, it wasn't designed with security or scalability in mind, just for local testing, so running it on a publicly-accessible site like PythonAnywhere would be risky anyway.

Perhaps a more useful question from me would be -- why do you want to run the Django runserver? If it's just out of interest, then hopefully I've answered that :-) If there's a specific thing you want to do, though, perhaps I can suggest a better way to do it here?

@giles, I would run another server in PA console is because I want to try '--insecure' parameter. Is there a way to use custom parameters to the 'default server', the one can be reloaded in Web tab? I want to try '--insecure' is because I was trying to solve static file not loading issue I encountered, now the static files issue is basically solved. So this question is not that urgent to me now. Thanks all the same if you can instruct me more.

--insecure doesn't really make sense in the context of the PythonAnywhere web servers. It's a specific argument to the Django runserver command to tell it how to handle static files and we don't use runserver to serve your web apps.

is nessasery to do PA console runserver? if i do not run django runserver is any problem?

You shouldn't use runserver. Your web apps should be configured on the Web page instead.