aircraft
aircraft

Reputation: 26896

Which server Django is using?

After we installed the Django, we use the command:

python manage.py runserver 

we can run a server, but I don't know the server is which server, and I searched the django directory, find the server is not in the directory:

aircraftdeMacBook-Pro:Django-1.11.2-py2.7.egg ldl$ cd django/
aircraftdeMacBook-Pro:django ldl$ ls
__init__.py bin     dispatch    shortcuts.pyc   utils
__init__.pyc    conf        forms       template    views
__main__.py contrib     http        templatetags
__main__.pyc    core        middleware  test
apps        db      shortcuts.py    urls

So, I have two questions:

  1. The server is which web-server, and how can I find its location?
  2. If we finish the application, if we use the web-server as the python-web's web-server(means why not apache or nginx)?
  3. The port default is 8000, how to change to the 80?

Upvotes: 5

Views: 6847

Answers (3)

BHa
BHa

Reputation: 68

1) Django provides a default wsgi server as @sach20 mentioned.

2) The django server should be used for development. I personally use nginx and gunicorn to run my server. You can find a tutorial on how to set on up here: Tutorial

3) You can run:

python manage.py runserver 0.0.0.0:80

You can substitute 80 with any port you want to use.

Upvotes: 3

WilomGfx
WilomGfx

Reputation: 2013

Django runserver is a local dev server, should not be used in production... APACHE AND NGINX are different things.

Django provides a simple WSGI server as a dev server.

Also id guess you have not looked inside the django docs because what you are looking for is right here

Examples of using different ports and addresses¶

Port 8000 on IP address 127.0.0.1:

django-admin runserver Port 8000 on IP address 1.2.3.4:

django-admin runserver 1.2.3.4:8000 Port 7000 on IP address 127.0.0.1:

django-admin runserver 7000

Upvotes: 4

sach20
sach20

Reputation: 45

Django provides a default wsgi development server

Upvotes: 1

Related Questions