Install mod_wsgi on Ubuntu with Python 3.6, Apache 2.4, and Django 1.11

后端 未结 2 658
迷失自我
迷失自我 2020-12-14 01:37

How do I get mod_wsgi for Apache2 that was compiled for Python 3.6.1?

(or any future Python version)

I am using a Python 3.6.1 virtual envi

2条回答
  •  感情败类
    2020-12-14 02:23

    Do the following.

    Uninstall your system mod_wsgi package.

    sudo apt-get remove libapache2-mod-wsgi-py3
    

    Install mod_wsgi using pip, preferably into a Python virtual environment. Ensure pip is for the version of Python you want to use.

    pip install mod_wsgi
    

    Display the config to add to Apache configuration file to load this mod_wsgi by running:

    mod_wsgi-express module-config
    

    Take the output of above command to display config and add to Apache configuration.

    Add configuration to Apache to load a hello world WSGI application to test it works.

    See details for pip based install in:

    • https://pypi.python.org/pypi/mod_wsgi

提交回复
热议问题