Why do I need Apache or nginx under Django?

Asked 2 years ago, Updated 2 years ago, 85 views

When doing web development in Django, most of the information is configured to run Django on the so-called Apache or nginx web server.
However, Django is a web server in itself, and I don't understand why I bother using Apache or nginx.
In some cases, Django is an application server, so it says that you need a web server under it, but I don't think it's necessary if Django's process is working.
If you trace Django's tutorials, you can communicate directly with HTTP, especially without running separate web server services.

These may not be limited to Django, but I'm confused because I don't know the background because I'm a beginner.
Why do I need Apache/nginx? Can't I host the web service only with Django?

python apache nginx django

2022-09-29 21:38

1 Answers

Not only Django, but also application servers are generally not published directly, but through web servers such as Apache and nginx.

This is largely because application servers do not have CPU and memory efficiency, leaving them to static, fast web servers such as image, style sheet and script files.

Other reasons include the need for Web servers to handle infrastructure-related tasks such as access control, or the flexibility of Web servers to handle multiple application servers (application servers are often low-functioning as web servers).


2022-09-29 21:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.