How to run two web sites or subdomains of a site from a single Django code base.
Each Django app in the project can then power a website on a different domain, but all the apps can still share a single database with a single administrative interface.
I'm Deploying with uWSGI-Nginx-Django
Thanks.
Best Answer
You have to deploy Django apps separately on uwsgi. An official site suggest to use emperor mode. First you have to write Upstart script at
/etc/init/uwsgi.conf
like this,In /etc/uwsgi/apps-enabled/, it'll contain your uwsgi configuration for each Django application. e.g. /etc/uwsgi/apps-enabled/app1.ini
Here's the sample configuration that I use.
To run two web sites or subdomains of a site from a single Django code base, you need to set your domain at server_name directive for each Django application For example /etc/nginx/sites-enabled/yourweb1.conf that's bind to DjangoApp1
/etc/nginx/sites-enabled/yourweb2.conf that's bind to DjangoApp2
More information about deploying Django application with nginx