Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Django without Apache using runserver on port 80 and accessible outside LAN

Tags:

apache

django

In debugging mode, I can run django web that can be accessed by public (inside LAN) with:

python manage.py runserver 0.0.0.0:8000

So, is it possible to run it directly on port 80 (maybe with a domain) like normally webserver does? If yes, is it a bad idea? I mean, is it better to use apache with mod_wsgi?

like image 496
Mas Bagol Avatar asked Jun 05 '15 15:06

Mas Bagol


1 Answers

Its possible, but its a really bad idea because the default server that django ships with does not support multiproccessing etc, and is meant solely for development.

As the documentation notes:

Now’s a good time to note: DON’T use this server in anything resembling a production environment. It’s intended only for use while developing. (We’re in the business of making Web frameworks, not Web servers.)

As for the choice of web server, do have a look at the django book to get more ideas around how to go ahead with it.

like image 148
Anshul Goyal Avatar answered Sep 24 '22 03:09

Anshul Goyal