Target WSGI script "wsgi.py" cannot be loaded as python module.

2,774 views
Skip to first unread message

David Cansler

unread,
Feb 7, 2018, 3:12:02 PM2/7/18
to modwsgi
I'm trying to deploy a Django app onto a Centos 6.9 server and I'm getting the error Target WSGI script "wsgi.py" cannot be loaded as pyhton module.
I've run through the troubleshooting tips and am now at a point where I could use some help.
Here's my setup

The server:
Last Update Run: Sun Feb 04 09:00:34 +0000 2018, state OK
Patching Group : auto
OS Detection   : CentOS 6.9 amd64 (yum)
KERNEL updates : false (2.6.32-504.23.4.el6.x86_64)

[devwebuser@87670-newsdev gov_salaries]$ httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Oct 19 2017 16:43:38
Server's Module Magic Number: 20051115:25
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Installed python3.6.4:
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"

Installed mod_wsgi-4.5.24
./configure --with-python=/usr/local/bin/python3.6
LD_RUN_PATH=/usr/local/lib make
sudo make install

Looks good with mod_wsgi and shared python library:
[devwebuser@87670-newsdev modules]$ ldd /etc/httpd/modules/mod_wsgi.so
linux-vdso.so.1 =>  (0x00007fff9f3f3000)
libpython3.6m.so.1.0 => /usr/local/lib/libpython3.6m.so.1.0 (0x00007f4aa66a6000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4aa647a000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4aa6276000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f4aa6073000)
librt.so.1 => /lib64/librt.so.1 (0x00007f4aa5e6a000)
libm.so.6 => /lib64/libm.so.6 (0x00007f4aa5be6000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4aa5852000)
/lib64/ld-linux-x86-64.so.2 (0x00000032f0c00000)

Create virtual environment, etc.:
[devwebuser@87670-newsdev gov_salaries]$ python3 -m venv /usr/local/webapps/gov_salaries/gov_venv
[devwebuser@87670-newsdev gov_salaries]$ source /usr/local/webapps/gov_salaries/gov_venv/bin/activate
(gov_venv) [devwebuser@87670-newsdev gov_salaries]$ pip install -r requirements.txt 
(gov_venv) [devwebuser@87670-newsdev gov_salaries]$ pip freeze
Django==1.11.4
django-bootstrap4==0.0.4
django-crispy-forms==1.6.1
django-debug-toolbar==1.9.1
django-filter==1.0.4
django-tables2==1.10.0
psycopg2==2.7.3.2
pytz==2017.2
sqlparse==0.2.4

Location of virtual environment:
(gov_venv) [devwebuser@87670-newsdev gov_salaries]$ python -c 'import sys; print(sys.prefix)'
/usr/local/webapps/gov_salaries/gov_venv

httpd.conf file (I deleted most commented lines for brevity):

ServerRoot "/etc/httpd"

PidFile run/httpd.pid

Timeout 60

KeepAlive Off
MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

<IfModule worker.c>
StartServers         4
MaxClients         300
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Listen 80

LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
# LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
# LoadModule autoindex_module modules/mod_autoindex.so
# LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
# LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule substitute_module modules/mod_substitute.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule version_module modules/mod_version.so
#LoadModule passenger_module /usr/lib64/ruby/gems/1.8/gems/passenger-4.0.59/buildout/apache2/mod_passenger.so
#
# The following modules are not loaded by default:
#
#LoadModule asis_module modules/mod_asis.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule cgid_module modules/mod_cgid.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule dumpio_module modules/mod_dumpio.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule wsgi_module modules/mod_wsgi.so
WSGISocketPrefix /var/run/wsgi

Include conf.d/*.conf

#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
ExtendedStatus On

#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  . On HPUX you may not be able to use shared memory as nobody, and the
#    suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000;
#  don't use Group #-1 on these systems!
#
User apache
Group apache

### Section 2: 'Main' server configuration
#
ServerAdmin SysA...@acsor.com


UseCanonicalName Off

DocumentRoot "/var/www/html/newsdev.oregonian.com"

<Directory />
Order Deny,Allow
deny from all
</Directory>

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html/newsdev.oregonian.com">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# for more information.
#
    Options -Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid.  This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
#
#<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    # UserDir disabled

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    #UserDir public_html

#</IfModule>


DirectoryIndex index.html index.html.var

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
TypesConfig /etc/mime.types

DefaultType text/plain

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
<IfModule mod_mime_magic.c>
#   MIMEMagicFile /usr/share/magic.mime
    MIMEMagicFile conf/magic
</IfModule>

HostnameLookups Off

ErrorLog logs/error_log

LogLevel info

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog logs/access_log combined

ServerSignature On

 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
 <Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
 </Directory>

AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw

LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

ForceLanguagePriority Prefer Fallback

AddDefaultCharset UTF-8

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl


AddHandler type-map var

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml


Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>

#    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
#    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
#    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
#    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
#    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
#    ErrorDocument 410 /error/HTTP_GONE.html.var
#    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
#    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
#    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
#    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
#    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
#    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
#    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
#    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
#    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
#    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

</IfModule>
</IfModule>

#
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

#
# The following directive disables redirects on non-GET requests for
# a directory that does not include the trailing slash.  This fixes a
# problem with Microsoft WebFolders which does not appropriately handle
# redirects for folders with DAV methods.
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

#
# Allow server status reports generated by mod_status,
# Change the ".example.com" to match your domain to enable.
#
<Location /server-status>
    SetHandler server-status
    Order allow,deny
    Allow from all
</Location>

#
# Allow remote server configuration reports, with the URL of
http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
#<Location /server-info>
#    SetHandler server-info
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>

#
# Proxy Server directives. Uncomment the following lines to
# enable the proxy server:
#
#<IfModule mod_proxy.c>
#ProxyRequests On
#
#<Proxy *>
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Proxy>

#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
#ProxyVia On

#
# To enable a cache of proxied content, uncomment the following lines.
#
#<IfModule mod_disk_cache.c>
#   CacheEnable disk /
#   CacheRoot "/var/cache/mod_proxy"
#</IfModule>
#

#</IfModule>
# End of proxy directives.

# Load Passenger module for Ruby

<IfModule mod_passenger.c>
PassengerRoot /usr/lib64/ruby/gems/1.8/gems/passenger-4.0.59
PassengerDefaultRuby /usr/bin/ruby
</IfModule>

### Section 3: Virtual Hosts
#

<VirtualHost *:80>
        ServerAdmin SysA...@acsor.com
        ServerName newsdev.oregonian.com
        DocumentRoot /var/www/html/newsdev.oregonian.com
        RewriteEngine On
        <Directory /var/www/html/newsdev.oregonian.com>
                Options -Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>

        Alias /static/ /var/www/static/

        WSGIDaemonProcess salaries python-home=/usr/local/webapps/gov_salaries/gov_venv
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptAlias /salaries /usr/local/webapps/gov_salaries/config/wsgi.py process-group=salaries

        <Directory /usr/local/webapps/gov_salaries>
            Order allow,deny
            Allow from all
        </Directory>

        <Directory /usr/local/webapps/gov_salaries/config>
            <Files wsgi.py>
            Order allow,deny
            Allow from all
            </Files>
        </Directory>

        <Directory /var/www/static>
            Order allow,deny
            Allow from all
        </Directory>



</VirtualHost>

<VirtualHost *:80>
ServerAdmin SysA...@acsor.com
        ServerName datawrapper.oregonian.com
        DocumentRoot /var/www/html/datawrapper/www
#RewriteEngine On
        <Directory /var/www/html/datawrapper/www/>
                Options -Indexes FollowSymLinks
AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerAdmin SysA...@acsor.com
        ServerName charts.oregonian.com
        DocumentRoot /var/www/html/datawrapper/charts/static
RewriteEngine On
        <Directory /var/www/html/datawrapper/charts/static/>
                Options -Indexes FollowSymLinks
AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>


<VirtualHost *:80>
ServerAdmin SysA...@acsor.com

#<Location /assets>
#ProxyPass !
#</Location>
#<Location /system>
#ProxyPass !
#</Location>
ProxyPassReverse / http://127.0.0.1:9292/

Options -Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Options -Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


<VirtualHost *:80>
        ServerAdmin SysA...@acsor.com
        ServerName testapp2.oregonian.com
        DocumentRoot /var/www/html/newsdev.oregonian.com/restaurants/current/public

        #<Location /assets>
                #ProxyPass !
        #</Location>
        #<Location /system>
                #ProxyPass !
        #</Location>
        ProxyPass / http://127.0.0.1:9293/
        ProxyPassReverse / http://127.0.0.1:9293/

        <Directory /var/www/html/newsdev.oregonian.com/current/public/system>
                Options -Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>

        <Directory /var/www/html/newsdev.oregonian.com/restaurants/current/assets>
                Options -Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

Alias /news_contacts /var/www/html/news_contacts/current/public
Options -Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

httpd error log:
[Wed Feb 07 11:09:48 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Feb 07 11:09:48 2018] [info] Init: Seeding PRNG with 256 bytes of entropy
[Wed Feb 07 11:09:48 2018] [info] Init: Initializing (virtual) servers for SSL
[Wed Feb 07 11:09:48 2018] [info] mod_ssl/2.2.15 compiled against Server: Apache/2.2.15, Library: OpenSSL/1.0.1e-fips
[Wed Feb 07 11:09:48 2018] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 07 11:09:48 2018] [notice] Digest: done
[Wed Feb 07 11:09:48 2018] [info] APR LDAP: Built with OpenLDAP LDAP SDK
[Wed Feb 07 11:09:48 2018] [info] LDAP: SSL support available
[Wed Feb 07 11:09:48 2018] [info] Init: Seeding PRNG with 256 bytes of entropy
[Wed Feb 07 11:09:48 2018] [info] Shared memory session cache initialised
[Wed Feb 07 11:09:48 2018] [info] Init: Initializing (virtual) servers for SSL
[Wed Feb 07 11:09:48 2018] [info] mod_ssl/2.2.15 compiled against Server: Apache/2.2.15, Library: OpenSSL/1.0.1e-fips
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9174): Starting process 'salaries' with uid=48, gid=48 and threads=15.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9174): Python home /usr/local/webapps/gov_salaries/gov_venv.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9174): Initializing Python.
[Wed Feb 07 11:09:48 2018] [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/4.5.24 Python/3.6 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
[Wed Feb 07 11:09:48 2018] [info] Server built: Oct 19 2017 16:43:38
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9177): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9176): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9175): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9178): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9179): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9180): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9181): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9182): Initializing Python.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9177): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9175): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9174): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9181): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9179): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9178): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9176): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9180): Attach interpreter ''.
[Wed Feb 07 11:09:48 2018] [info] mod_wsgi (pid=9182): Attach interpreter ''.
[Wed Feb 07 11:10:32 2018] [info] [client 50.202.228.131] mod_wsgi (pid=9174, process='salaries', application=''): Loading WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131] mod_wsgi (pid=9174): Target WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py' cannot be loaded as Python module.
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131] mod_wsgi (pid=9174): Exception occurred processing WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131] Traceback (most recent call last):
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/config/wsgi.py", line 21, in <module>
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]     application = get_wsgi_application()
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]     django.setup(set_prefix=False)
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/__init__.py", line 22, in setup
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]     self._setup(name)
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/conf/__init__.py", line 41, in _setup
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]     self._wrapped = Settings(settings_module)
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/conf/__init__.py", line 110, in __init__
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[Wed Feb 07 11:10:32 2018] [error] [client 50.202.228.131] ModuleNotFoundError: No module named 'gov_salaries'

wsgi.py file:
import sys
import site
import os

sys.path.append('/usr/local/webapps/gov_salaries')
sys.path.append('/usr/local/webapps/gov_salaries/salaries')

from django.core.wsgi import get_wsgi_application

#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
os.environ["DJANGO_SETTINGS_MODULE"] = "gov_salaries.settings"
application = get_wsgi_application()

Graham Dumpleton

unread,
Feb 7, 2018, 5:13:20 PM2/7/18
to mod...@googlegroups.com
Where is the gov_salaries package installed?

If you can import it from command line Python, what does:

    print(gov_salaries.__file__)

show?

Graham

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

David Cansler

unread,
Feb 7, 2018, 5:36:55 PM2/7/18
to modwsgi
Thanks for your quick response Graham.
This is our first django app and while we have developed the app somewhat successfully (it's still a work in progress), deployment has been left to me. I couldn't find a 'definitive' place where I should put the app, so I made a webapps directory at /usr/local (/usr/local/webapps/gov_salaries)
Here's my attempt at doing what you asked to help me troubleshoot. (again, thanks for taking the time):

(gov_venv) [devwebuser@87670-newsdev gov_salaries]$ python manage.py shell
Python 3.6.4 (default, Feb  2 2018, 16:08:02) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> print(gov_salaries.__file__)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'gov_salaries' is not defined
>>> import gov_salaries
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'gov_salaries'
>>> import salaries
>>> print(salaries.__file__)
/usr/local/webapps/gov_salaries/salaries/__init__.py

Graham Dumpleton

unread,
Feb 7, 2018, 6:05:37 PM2/7/18
to mod...@googlegroups.com
Lets try this a different way. What is the full path to the Django settings.py file for the project.

Graham

David Cansler

unread,
Feb 7, 2018, 6:11:34 PM2/7/18
to modwsgi

/usr/local/webapps/gov_salaries/config/settings.py

Graham Dumpleton

unread,
Feb 7, 2018, 6:27:05 PM2/7/18
to mod...@googlegroups.com
There are a few issues here to sort out.

You said the wsgi.py file contained:

import sys
import site
import os

sys.path.append('/usr/local/webapps/gov_salaries')
sys.path.append('/usr/local/webapps/gov_salaries/salaries')

from django.core.wsgi import get_wsgi_application

#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
os.environ["DJANGO_SETTINGS_MODULE"] = "gov_salaries.settings"
application = get_wsgi_application()

The sys.path.append() calls are intended to say where the project code is. It should add the directory which is parent to the project, not the project directory itself. You shouldn't have to add any sub directories of the project directory either.

Ideally though you would not do it this way when using mod_wsgi daemon mode. The better way is to use the python-path option to WSGIDaemonProcess.

WSGIDaemonProcess salaries \
    python-home=/usr/local/webapps/gov_salaries/gov_venv \
    python-path=/usr/local/webapps

Problem is that what you are setting DJANGO_SETTINGS_MODULE to in the wsgi.py file doesn't match what you are using. You said the Django settings file was at:

    /usr/local/webapps/gov_salaries/config/settings.py

The import path for that would mean should use:

    os.environ["DJANGO_SETTINGS_MODULE"] = "gov_salaries.config.settings"

Normally it would be:

    os.environ["DJANGO_SETTINGS_MODULE"] = "gov_salaries.settings"

but your code appears to have been reorganised.

When pushing config down a level like that you need to be a bit careful and ensure BASE_DIR in the settings module file has been changed to correct work out the top level directory.

To sort out what probably has to be used, look in the manage.py file and see what DJANGO_SETTINGS_MODULE was being set to in that. It should be the same.

Graham

David Cansler

unread,
Feb 7, 2018, 7:11:14 PM2/7/18
to modwsgi
That makes sense. We did indeed rearrange the structure - we were following the "Two-Scoops of Django" book, which recommended the config folder.

I've changed the line in wsgi.py to os.environ["DJANGO_SETTINGS_MODULE"] = "gov_salaries.config.settings" and then changed it in the manage.py file to match. 

I've gotten rid of the sys.path.append() calls and added python-path=/usr/local/webapps to the daemon process in the httpd.conf as you recommend

Unfortunately I'm still getting the 'Target WSGI script cannot be loaded..."

Graham Dumpleton

unread,
Feb 7, 2018, 7:12:33 PM2/7/18
to mod...@googlegroups.com
Can I see the latest error messages to confirm what you are getting?

Graham

David Cansler

unread,
Feb 7, 2018, 7:16:36 PM2/7/18
to modwsgi
[Wed Feb 07 17:15:26 2018] [notice] caught SIGTERM, shutting down
[Wed Feb 07 17:15:27 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Feb 07 17:15:27 2018] [info] Init: Seeding PRNG with 256 bytes of entropy
[Wed Feb 07 17:15:27 2018] [info] Init: Initializing (virtual) servers for SSL
[Wed Feb 07 17:15:27 2018] [info] mod_ssl/2.2.15 compiled against Server: Apache/2.2.15, Library: OpenSSL/1.0.1e-fips
[Wed Feb 07 17:15:27 2018] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 07 17:15:27 2018] [notice] Digest: done
[Wed Feb 07 17:15:27 2018] [info] APR LDAP: Built with OpenLDAP LDAP SDK
[Wed Feb 07 17:15:27 2018] [info] LDAP: SSL support available
[Wed Feb 07 17:15:27 2018] [info] Init: Seeding PRNG with 256 bytes of entropy
[Wed Feb 07 17:15:27 2018] [info] Shared memory session cache initialised
[Wed Feb 07 17:15:27 2018] [info] Init: Initializing (virtual) servers for SSL
[Wed Feb 07 17:15:27 2018] [info] mod_ssl/2.2.15 compiled against Server: Apache/2.2.15, Library: OpenSSL/1.0.1e-fips
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12707): Starting process 'salaries' with uid=48, gid=48 and threads=15.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12707): Python home /usr/local/webapps/gov_salaries/gov_venv.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12707): Initializing Python.
[Wed Feb 07 17:15:27 2018] [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/4.5.24 Python/3.6 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
[Wed Feb 07 17:15:27 2018] [info] Server built: Oct 19 2017 16:43:38
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12710): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12709): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12711): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12708): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12713): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12712): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12714): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12715): Initializing Python.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12707): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12708): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12712): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12709): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12710): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12711): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12714): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12713): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12715): Attach interpreter ''.
[Wed Feb 07 17:15:27 2018] [info] mod_wsgi (pid=12707): Adding '/usr/local/webapps' to path.
[Wed Feb 07 17:15:32 2018] [info] [client 50.202.228.131] mod_wsgi (pid=12707, process='salaries', application=''): Loading WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131] mod_wsgi (pid=12707): Target WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py' cannot be loaded as Python module.
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131] mod_wsgi (pid=12707): Exception occurred processing WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131] Traceback (most recent call last):
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/config/wsgi.py", line 18, in <module>
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]     application = get_wsgi_application()
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]     django.setup(set_prefix=False)
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]     apps.populate(settings.INSTALLED_APPS)
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]     app_config = AppConfig.create(entry)
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/apps/config.py", line 94, in create
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]     module = import_module(entry)
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[Thu Feb 08 00:15:33 2018] [error] [client 50.202.228.131] ModuleNotFoundError: No module named 'salaries'

Graham Dumpleton

unread,
Feb 7, 2018, 7:20:40 PM2/7/18
to mod...@googlegroups.com
If you have additional Django applications and they are within the project directory and you aren't using the project name in the module path for them, use:

WSGIDaemonProcess salaries \
    python-home=/usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries \
    python-path=/usr/local/webapps

So it got past the Django settings at least and you do need to add project directory because of structure you are using.

You risk having modules which can be imported via two different paths this way though. Eg.

    salaries

and:

    gov_saleries.saleries

If they are applications, you may want to consider locating them separate to the project directory to avoid such problems.

Anyway, try that change first to get it working.

Graham

David Cansler

unread,
Feb 7, 2018, 7:48:43 PM2/7/18
to modwsgi
The error is looking more reasonable...most likely I have a permissions issue? Sorry that you're having to debug our dumpster fire of an app. I can't express my thanks enough.
I've not been able to find exactly what permissions should be for both the app and the python path.
Here's the current httpd error log after adding
 WSGIDaemonProcess salaries \
    python-home=/usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries \
    python-path=/usr/local/webapps :

[Wed Feb 07 17:22:58 2018] [notice] caught SIGTERM, shutting down
[Wed Feb 07 17:22:59 2018] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Feb 07 17:22:59 2018] [info] Init: Seeding PRNG with 256 bytes of entropy
[Wed Feb 07 17:22:59 2018] [info] Init: Initializing (virtual) servers for SSL
[Wed Feb 07 17:22:59 2018] [info] mod_ssl/2.2.15 compiled against Server: Apache/2.2.15, Library: OpenSSL/1.0.1e-fips
[Wed Feb 07 17:22:59 2018] [notice] Digest: generating secret for digest authentication ...
[Wed Feb 07 17:22:59 2018] [notice] Digest: done
[Wed Feb 07 17:22:59 2018] [info] APR LDAP: Built with OpenLDAP LDAP SDK
[Wed Feb 07 17:22:59 2018] [info] LDAP: SSL support available
[Wed Feb 07 17:22:59 2018] [info] Init: Seeding PRNG with 256 bytes of entropy
[Wed Feb 07 17:22:59 2018] [info] Shared memory session cache initialised
[Wed Feb 07 17:22:59 2018] [info] Init: Initializing (virtual) servers for SSL
[Wed Feb 07 17:22:59 2018] [info] mod_ssl/2.2.15 compiled against Server: Apache/2.2.15, Library: OpenSSL/1.0.1e-fips
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12833): Starting process 'salaries' with uid=48, gid=48 and threads=15.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12833): Python home /usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries.
[Wed Feb 07 17:22:59 2018] [warn] (2)No such file or directory: mod_wsgi (pid=12833): Unable to stat Python home /usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12833): Initializing Python.
[Wed Feb 07 17:22:59 2018] [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/4.5.24 Python/3.6 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations
[Wed Feb 07 17:22:59 2018] [info] Server built: Oct 19 2017 16:43:38
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f4ec89307e0 (most recent call first):
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12836): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12835): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12837): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12838): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12834): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12839): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12840): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12841): Initializing Python.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12836): Attach interpreter ''.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12839): Attach interpreter ''.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12834): Attach interpreter ''.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12835): Attach interpreter ''.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12841): Attach interpreter ''.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12840): Attach interpreter ''.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12838): Attach interpreter ''.
[Wed Feb 07 17:22:59 2018] [info] mod_wsgi (pid=12837): Attach interpreter ''.
[Wed Feb 07 17:23:00 2018] [notice] child pid 12833 exit signal Aborted (6)
[Wed Feb 07 17:23:00 2018] [info] mod_wsgi (pid=12833): Process 'salaries' has died, deregister and restart it.
[Wed Feb 07 17:23:00 2018] [info] mod_wsgi (pid=12833): Process 'salaries' terminated by signal 6
[Wed Feb 07 17:23:00 2018] [info] mod_wsgi (pid=12833): Process 'salaries' has been deregistered and will no longer be monitored.
[Wed Feb 07 17:23:00 2018] [info] mod_wsgi (pid=12842): Starting process 'salaries' with uid=48, gid=48 and threads=15.
[Wed Feb 07 17:23:00 2018] [info] mod_wsgi (pid=12842): Python home /usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries.
[Wed Feb 07 17:23:00 2018] [warn] (2)No such file or directory: mod_wsgi (pid=12842): Unable to stat Python home /usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
[Wed Feb 07 17:23:00 2018] [info] mod_wsgi (pid=12842): Initializing Python.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f4ec89307e0 (most recent call first):
[Wed Feb 07 17:23:01 2018] [notice] child pid 12842 exit signal Aborted (6)
[Wed Feb 07 17:23:01 2018] [info] mod_wsgi (pid=12842): Process 'salaries' has died, deregister and restart it.
[Wed Feb 07 17:23:01 2018] [info] mod_wsgi (pid=12842): Process 'salaries' terminated by signal 6
[Wed Feb 07 17:23:01 2018] [info] mod_wsgi (pid=12842): Process 'salaries' has been deregistered and will no longer be monitored.
[Wed Feb 07 17:23:01 2018] [info] mod_wsgi (pid=12844): Starting process 'salaries' with uid=48, gid=48 and threads=15.
[Wed Feb 07 17:23:01 2018] [info] mod_wsgi (pid=12844): Python home /usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries.
[Wed Feb 07 17:23:01 2018] [warn] (2)No such file or directory: mod_wsgi (pid=12844): Unable to stat Python home /usr/local/webapps/gov_salaries/gov_venv:/usr/local/webapps/gov_salaries/gov_venv/gov_salaries. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
[Wed Feb 07 17:23:01 2018] [info] mod_wsgi (pid=12844): Initializing Python.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Graham Dumpleton

unread,
Feb 7, 2018, 7:51:09 PM2/7/18
to mod...@googlegroups.com
That one was my fault. Added path to wrong option. Should be:

WSGIDaemonProcess salaries \
    python-home=/usr/local/webapps/gov_salaries/gov_venv \
    python-path=/usr/local/webapps:/usr/local/webapps/gov_salaries

Graham

David Cansler

unread,
Feb 7, 2018, 8:02:08 PM2/7/18
to modwsgi
Thanks, I should have caught that. I've got a new error:
[Wed Feb 07 17:54:27 2018] [info] Server built: Oct 19 2017 16:43:38
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14998): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14997): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14996): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14999): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15000): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15002): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15003): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15001): Initializing Python.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14995): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15000): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14998): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14996): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15002): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14999): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14997): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15003): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=15001): Attach interpreter ''.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14995): Adding '/usr/local/webapps' to path.
[Wed Feb 07 17:54:27 2018] [info] mod_wsgi (pid=14995): Adding '/usr/local/webapps/gov_salaries' to path.
[Wed Feb 07 17:55:06 2018] [info] [client 50.202.228.131] mod_wsgi (pid=14995, process='salaries', application=''): Loading WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] mod_wsgi (pid=14995): Target WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py' cannot be loaded as Python module.
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] mod_wsgi (pid=14995): Exception occurred processing WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] Traceback (most recent call last):
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 33, in get_module_path
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     module = import_module(module_name)
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] ModuleNotFoundError: No module named 'wsgiref'
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] 
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] During handling of the above exception, another exception occurred:
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] 
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] Traceback (most recent call last):
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/config/wsgi.py", line 18, in <module>
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     application = get_wsgi_application()
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     return WSGIHandler()
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 151, in __init__
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     self.load_middleware()
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 80, in load_middleware
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     middleware = import_string(middleware_path)
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 20, in import_string
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     module = import_module(module_path)
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/middleware.py", line 17, in <module>
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     from debug_toolbar.toolbar import DebugToolbar
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 135, in <module>
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     urlpatterns = DebugToolbar.get_urls()
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 128, in get_urls
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     for panel_class in cls.get_panel_classes():
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 111, in get_panel_classes
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     for panel_path in dt_settings.get_panels()
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 111, in <listcomp>
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     for panel_path in dt_settings.get_panels()
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 20, in import_string
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     module = import_module(module_path)
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/panels/__init__.py", line 8, in <module>
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     from debug_toolbar.utils import get_name_from_obj
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 46, in <module>
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     for module_name in dt_settings.get_config()['HIDE_IN_STACKTRACES']
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 46, in <listcomp>
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     for module_name in dt_settings.get_config()['HIDE_IN_STACKTRACES']
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 36, in get_module_path
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131]     'Error importing HIDE_IN_STACKTRACES: %s' % (e,))
[Thu Feb 08 00:55:07 2018] [error] [client 50.202.228.131] django.core.exceptions.ImproperlyConfigured: Error importing HIDE_IN_STACKTRACES: No module named 'wsgiref'
[Thu Feb 08 00:55:09 2018] [info] [client 50.202.228.131] mod_wsgi (pid=14995, process='salaries', application=''): Loading WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] mod_wsgi (pid=14995): Target WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py' cannot be loaded as Python module.
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] mod_wsgi (pid=14995): Exception occurred processing WSGI script '/usr/local/webapps/gov_salaries/config/wsgi.py'.
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] Traceback (most recent call last):
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 33, in get_module_path
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     module = import_module(module_name)
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] ModuleNotFoundError: No module named 'wsgiref'
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] 
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] During handling of the above exception, another exception occurred:
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] 
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] Traceback (most recent call last):
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/config/wsgi.py", line 18, in <module>
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     application = get_wsgi_application()
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     return WSGIHandler()
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 151, in __init__
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     self.load_middleware()
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 80, in load_middleware
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     middleware = import_string(middleware_path)
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 20, in import_string
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     module = import_module(module_path)
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/middleware.py", line 17, in <module>
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     from debug_toolbar.toolbar import DebugToolbar
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 135, in <module>
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     urlpatterns = DebugToolbar.get_urls()
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 128, in get_urls
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     for panel_class in cls.get_panel_classes():
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 111, in get_panel_classes
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     for panel_path in dt_settings.get_panels()
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/toolbar.py", line 111, in <listcomp>
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     for panel_path in dt_settings.get_panels()
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 20, in import_string
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     module = import_module(module_path)
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/panels/__init__.py", line 8, in <module>
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     from debug_toolbar.utils import get_name_from_obj
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 46, in <module>
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     for module_name in dt_settings.get_config()['HIDE_IN_STACKTRACES']
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 46, in <listcomp>
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     for module_name in dt_settings.get_config()['HIDE_IN_STACKTRACES']
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]   File "/usr/local/webapps/gov_salaries/gov_venv/lib/python3.6/site-packages/debug_toolbar/utils.py", line 36, in get_module_path
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131]     'Error importing HIDE_IN_STACKTRACES: %s' % (e,))
[Thu Feb 08 00:55:09 2018] [error] [client 50.202.228.131] django.core.exceptions.ImproperlyConfigured: Error importing HIDE_IN_STACKTRACES: No module named 'wsgiref'

On Wednesday, February 7, 2018 at 12:12:02 PM UTC-8, David Cansler wrote:

David Cansler

unread,
Feb 7, 2018, 8:12:59 PM2/7/18
to modwsgi
nevermind! This error is specific to the django debug toolbar. I'm seeing the app on the web page, albeit with some errors I'll have to workthrough.
Thanks again for your help Graham. much appreciated.
...
Reply all
Reply to author
Forward
0 new messages