Vineet Dwivedi's Blog

My musings on technology, entrepreneurship and other things.

Setting up multiple Django apps with nginx and uWSGI

Jan 18, 2020 1 min read Code Tutorials Vineet Dwivedi

It is a waste of precious resources (and money) if you are running a single Django app in a server. You can actually configure the server to run multiple apps (read domains) and control each of the apps independently with these easy steps. These commands are for CentOS. Please modify if you are using Debian or Ubuntu.

  • Install nginx and configure
sudo yum install nginx
  • Install uWSGI in emperor mode. Read full instruction here
pip install uwsgi
  • Create separate vassal for each Django app and link to its own virtual environment

  • You can reload an app, without affecting any other app, with these simple commands

cd /etc/uwsgi/vassals
touch your_config_file_name