-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Tue, Jan 15, 2019 at 08:04:23PM -0800, ANi wrote:
> Hey guys.

Maybe consider asking not just the guys next time. ;)

> I am trying to deploy my Django project on CentOS 7 with Apache.
> and I got an error of  *ImportError: No module named django.core.wsgi*
> I think it is because the Apache did not use the python version inside the 
> virtualenv
> However I dont know where the problem is.
> 
> this is my httpd.conf 
> WSGIProcessGroup project
> WSGIDaemonProcess project python-path=/var/www/html/project:/var/www/html/
> inv/Lib/python3.7/site-packages
> WSGIPythonPath /var/www/html/project:/var/www/html/inv/Lib/python3.7/site-
> packages
> 
> Alias /static "/var/www/html/project/static-files"
> <Directory "/var/www/html/project/static-files">
>         Require all granted
> </Directory>
> 
> 
> <Directory "/var/www/html/project/project">
> <Files wsgi.py>
>         Require all granted
> </Files>
> 
> I install wsgi_mod by *yum install mod_wsgi*
> [mpm_prefork:notice] [pid 25884] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.
> 2k-fips mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.5 configured -- resuming 
> normal operations

As the log line above indicates, the mod_wsgi you're using is built
against Python 2.7.5, but you're configuring it to point to a Python
3.7 environment; that will not work.

A quick search of the internets indicates that CentOS 7 does not
provide a mod_wsgi package built against any other version of Python
than 2.7, which means you'll need to build it yourself.

One way would be to use pip to install mod_wsgi in your application's
virtualenv (you'll need to ensure that you have all the necessary
header files for apache and Python installed), and then execute::

    mod_wsgi-express module-config

which will show you the lines you need to insert into your apache
config in order to use that build of mod_wsgi. More details are
explained at
https://pypi.org/project/mod_wsgi/#connecting-into-apache-installation.

Good luck,

Michal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJcPv4XAAoJEHA7T/IPM/klJ9MQAMYJ60aXMk2c1ZsqIP0yuRfS
GEOKVGM53pPTKWBt74fVkMSRCg8A6pC/Vmwka9f/wBCbG6/5QeFzYu0usuiTTGM0
m3KjjddEr0f7zr4KABkzsT9Q7F1gRymRqG3tqec40dLTPfLbiyITy5MUBGi0g8VS
cqSHfXhqQLHls3EjqH5gDgQy9i7J3GvJmjO5be9HEqnukO3o2NIff6mCnTmx1+TX
irvnXJ3th29j8Z7iHHl11JzWQgNQf4xKPZkpIb8x9DcZ66Its7fnx//bAkWcngAw
BpglB3GkAuyLi8XgTDlSEkwbNqJS00bjwZ/RWzfHwnXyu684quZMqDdLk7pJdn0I
uJH0d47zb3NHlOy1ODBrkds6QJMxW84x5jMpZnmeCs0O+h4A+zm42TFvTGKf7DlG
Tu8p5ZjMLD1oB1MEypdXJuURO2fUKigHHMjstBl7oJ04zoaZ8UWgJnMAxrjRCIJH
G0u4Un/O5cMTAKEzakaHvn0FJ5okwXhF+Pdn8g5oIPedBZNhiG4jg7cu4VjOz3/s
B/FADAh/ZHPkLe9aMe/I4L+oMxr4daCDw09TiT4eMFH8qYkIv+VBqRx9Gb7d0Fu5
Gp74k7cclszfSSfXZzIM+AAsDhTg+njzOgMO6tazYW/APBABOWQygvgtEGPvgOJo
Ln0azAuyh+PShZW5JXeg
=X2I7
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20190116094912.GA8269%40koniiiik.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to