Install Supervisor Gunicorn Virtualenv Django in Debian

Install Supervisor:

using pip

or apt-get

Add your project configuration file in the directory supervisor use at startup

Supposing you have a gunicorn conf file already written, like this for example:

write your supervisor file configuration:

If you get a UnicodeEncodeError

Add this environment line

in the [supervisord] section of

to avoid this error

If you’re taking advantage of the internationalization features of Django (see Internationalization and localization) and you intend to allow users to upload files, you must ensure that the environment used to start Apache is configured to accept non-ASCII file names. If your environment is not correctly configured, you will trigger UnicodeEncodeError exceptions when calling functions like os.path() on filenames that contain non-ASCII characters.

To avoid these problems, the environment used to start Apache should contain settings analogous to the following:

Consult the documentation for your operating system for the appropriate syntax and location to put these configuration items; /etc/apache2/envvars is a common location on Unix platforms. Once you have added these statements to your environment, restart Apache.

to test your configuration

this could be enough, to stop your app

to start it manually again