L
L
longcat2015-03-17 11:13:51
Django
longcat, 2015-03-17 11:13:51

How to configure launch of multiple django applications on nginx + uwsgi + django bundle?

One application is already working, but two django applications are needed, each on its own address name1.host.ru and name2.host.ru
It seems that there is some kind of imperor mode for uwsgi, but I don’t understand how to use it and how to bind several to it applications. Or is imperor mode just an automatic launch of uwsgi on a separate port for all applications found in the directory?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
un1t, 2015-03-17
@longcat

What ports? Better unix sockets and use config.
For each application, create your own config in /etc/uwsgi/apps-enabled/

[uwsgi]
plugins=python27
vhost=true
virtualenv=/home/ubuntu/myproject/python
module=project.wsgi
callable=application
pythonpath=/home/ubuntu/myproject
chdir=/home/ubuntu/myproject
processes=1

By default, the socket is created here,
but you can specify your path with the socket
option . Well, the nginx config, respectively:
server {
    listen 80;
    server_name  example.ru;

    location / {
        uwsgi_pass      unix:/var/run/uwsgi/app/myproject/socket;
        include         uwsgi_params;
    }

A
Andrey K, 2015-03-17
@mututunus

Run on different ports.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question