Running Django project on Apache production server with mod_wsgi

django

This is official tutorial. But it didn’t work for me for 100 %. But there is some useful information on wsgi and daemon process that should be created.

There is a good tutorial, that I followed and it actually works. But I decided to write my own post with instructions for my personal project:

First we enter the production server via SSL and create a virtual environment there:

Then we activate it:

Check the Django version. It must be the same as in your local server:

Save somewhere a path to a Django project:

Your path will be different.

This is an example of a sites-available/*.conf file setting to run Django with WSGI:
Снимок экрана 2014-09-19 в 20.25.49

Here app_server is the name of my Django project or you can name it a site. But in my case it is not site but server for a mobile application.

Python and Django version on server and virtual environment may be different. You should do everything inside virtual environments with the same versions on local and production servers.

Leave a Reply

Your email address will not be published. Required fields are marked *