How to setup with apache wsgi django?

71 views
Skip to first unread message

Rohan Nandode

unread,
Oct 19, 2013, 1:38:33 AM10/19/13
to python...@googlegroups.com
Could you point out how to setup django pulsar with WSGI on Apache?
I could run the example chat app with "python manage.py pulse", but would like to setup with apache wsgi along with another djano app/website.

Thanks
Rohan

lsbardel

unread,
Oct 19, 2013, 7:03:50 AM10/19/13
to python...@googlegroups.com

Could you point out how to setup django pulsar with WSGI on Apache?

To run pulsar behind apache you need to use the mod_proxy


you cannot use mod_wsgi.

I could run the example chat app with "python manage.py pulse", but would like to setup with apache wsgi along with another djano app/website.


You still run your pulsar server in that way and configure apache to proxy the requests to it.
Something like this

<VirtualHost *:80>
    ServerName server_ip
    ServerAlias server
    ...
    ProxyPass / http://127.0.0.1:8060/
    ProxyPassReverse / http://127.0.0.1:8060/

</VirtualHost>

I've never setup pulsar with apache before, therefore I'm not sure what is the best way to do that.

I use pulsar behind nginx in the same way as gunicorn does.

Rohan Nandode

unread,
Oct 21, 2013, 2:21:55 AM10/21/13
to python...@googlegroups.com
Thanks lsbardel.

So does that mean the pulse server is production ready and efficient?
The question is because the django's dev-server is not recommended for production.

Thanks
Rohan

lsbardel

unread,
Oct 21, 2013, 4:43:21 AM10/21/13
to python...@googlegroups.com

So does that mean the pulse server is production ready and efficient?

Pulse is the django command for running django on a pulsar wsgi server [1].
The server [1] is production ready and designed to easily handle fast, scalable http applications. As all pulsar servers, it uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.

The wsgi server is a specialized pulsar SocketServer [2] and you can use its multiprocessing capabilities to further bust its serving power [3].

The question is because the django's dev-server is not recommended for production.

Yes, django server is only for development. Pulsar is for production.
Of course you can use pulsar for development too, and when you do that you usually run it as a single process server in this way:

    python manage.py -w 0

On thing to bear in mind is the performance of your application. Pulsar can be efficient and scalable, but if your wsgi application is not friendly enough you may well have poor performance.
Most web-framework in the public domain, including django, are not asynchronous by construction. This is ok as long as the wsgi callable consumes the request and return control to pulsar as fast as possible.

Rohan Nandode

unread,
Oct 21, 2013, 5:41:25 AM10/21/13
to python...@googlegroups.com
Thanks again Isbardel.
This is really useful and helpful information.

Regards
Rohan
Reply all
Reply to author
Forward
0 new messages