Sunday, April 26, 2020

Abhijeet Pal: How To Deploy Django App with Nginx, Gunicorn, PostgreSQL and Let’s Encrypt SSL on Ubuntu

Django is a high-level full-stack open-source web framework written in Python, that encourages rapid development and clean, pragmatic design. Django is the go-to framework for any project irrespective of size, from a basic blog to a full-fledged social media app. Out of the box, Django comes with a built-in development server that is used locally. However, it isn’t suitable for the production environment because it’s single-threaded and lacks security measures. In this article, we will learn how to deploy a Django application with Nginx, Gunicorn, PostgreSQL, and Let’s Encrypt SSL on an Ubuntu server. Production Stack Architecture A modern Django application’s production stack is built with the following components. OS – Ubuntu WSGI Server – Gunicorn Web Server – Nginx Database – PostgreSQL The following diagram illustrates how Django works in the production environment. The following will happen when the client browser launches an HTTP request NGINX receives the HTTP request. If a static file is requested, NGINX serves the static file directly. If a dynamic page is requested, NGINX delegates the request to Gunicorn through a UNIX socket. Gunicorn …

The post How To Deploy Django App with Nginx, Gunicorn, PostgreSQL and Let’s Encrypt SSL on Ubuntu appeared first on Django Central.



from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...