> On 14 Aug 2017, at 8:42 am, [email protected] <[email protected]> 
> wrote:
> 
> 
> 
> down vote
>  <>favorite
>  
> <https://stackoverflow.com/questions/45665314/django-apache-mod-wsgi-on-windows#>
>     
> I am trying to get a django app running on Windows Server 2016 using apache 
> and mod_wsgi and python2.7. I have tried many, many different things based on 
> what I have read at these (and other) links:
> 
> How to install mod_wsgi for apache 2.4 and python 3.4 on windows? 
> <https://stackoverflow.com/questions/42298503/how-to-install-mod-wsgi-for-apache-2-4-and-python-3-4-on-windows>
> https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst 
> <https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst>
> Currently I have apache installed from 
> https://www.apachelounge.com/download/VC10/binaries/httpd-2.4.23-win32.zip 
> <https://www.apachelounge.com/download/VC10/binaries/httpd-2.4.23-win32.zip> 
> and pip install mod_wsgi runs without errors, but when I run mod_wsgi-express 
> module-configI get:
> 
> LoadModule wsgi_module 
> "c:/python27/lib/site-packages/mod_wsgi/server/mod_wsgiNone"
> WSGIPythonHome "c:/python27"
> What is that None at the end of the path?
> 

Can you give me a list of all the files which can be found in the directory:

    c:/python27/lib/site-packages/mod_wsgi/server

The current code used to calculate the path for LoadModule on Windows is:

    if os.name == 'nt':
        real_prefix = getattr(sys, 'real_prefix', None)
        real_prefix = real_prefix or sys.prefix

        library_version = sysconfig.get_config_var('VERSION')

        library_name = 'python%s.dll' % library_version
        library_path = os.path.join(real_prefix, library_name)

        if not os.path.exists(library_path):
            library_name = 'python%s.dll' % library_version[0]
            library_path = os.path.join(real_prefix, 'DLLs', library_name)

        if not os.path.exists(library_path):
            library_path = None

        if library_path:
            library_path = os.path.normpath(library_path)
            library_path = library_path.replace('\\', '/')

            print('LoadFile "%s"' % library_path)

        module_path = where()
        module_path = module_path.replace('\\', '/')

        prefix = sys.prefix
        prefix = os.path.normpath(prefix)
        prefix = prefix.replace('\\', '/')

        print('LoadModule wsgi_module "%s"' % module_path)
        print('WSGIPythonHome "%s"' % prefix)

The definition of where() is:

MOD_WSGI_SO = 'mod_wsgi-py%s%s' % (_py_version, _py_soext)
MOD_WSGI_SO = os.path.join(os.path.dirname(__file__), MOD_WSGI_SO)

if not os.path.exists(MOD_WSGI_SO) and _py_soabi:
    MOD_WSGI_SO = 'mod_wsgi-py%s.%s%s' % (_py_version, _py_soabi, _py_soext)
    MOD_WSGI_SO = os.path.join(os.path.dirname(__file__), MOD_WSGI_SO)

if not os.path.exists(MOD_WSGI_SO) and os.name == 'nt':
    MOD_WSGI_SO = 'mod_wsgi%s' % 
distutils.sysconfig.get_config_var('EXT_SUFFIX')
    MOD_WSGI_SO = os.path.join(os.path.dirname(__file__), MOD_WSGI_SO)

def where():
    return MOD_WSGI_SO

So the call to:

  distutils.sysconfig.get_config_var('EXT_SUFFIX')

must be returning None.

Can you run the following Python script snippet, from the command line or in 
Python interpreter.

    import distutils.sysconfig
    for key,value in distutils.sysconfig.get_config_vars().items():
        if value in ['.pyd', '.PYD', '.so', '.SO', '.pyo', '.PYO', '.dll', 
'.DLL']: print key,value

If that doesn't yield anything, provide me the output of:

    print distutils.sysconfig.get_config_vars()

Thanks.

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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to