[mod_python] Configuring Apache with mod_python for WSGI
Grisha Trubetskoy
grisha at modpython.org
Wed Sep 23 20:57:39 UTC 2015
That's just normal Python semantics: when a .py file is in a
directory, you import it by using the directory name (which
technically becomes a package name) followed by the file name without
the extension. So in this case we have a directory (package) called
"mysite", and in it a module called "wsgi.py", so in the configuration
we specify is as "mysite.wsgi"
On Wed, Sep 23, 2015 at 4:14 PM, Dallas Brown <kdbdallas at gmail.com> wrote:
> Ok, but that still leaves the question as to what the wsgi.py file is and what the mysite.wsgi file is?
> The docs are not clear as to which one holds the listed “def application()” ‘hello world’ code, and what the other one is.
>
> Thanks for the insight on the double paths, I will give that a try once I figure out the above file issue.
>
>
>
>> On Sep 23, 2015, at 11:27 AM, Grisha Trubetskoy <grisha at modpython.org> wrote:
>>
>> Dallas
>>
>> I think the docs are correct. The key thing being "Assuming there
>> exists the following minimal WSGI app residing in a file named
>> mysite/wsgi.py in directory /path/to/mysite (so that the full path to
>> wsgi.py is /path/to/mysite/mysite/wsgi.py)" (note how mysite is in the
>> path twice).
>>
>> And then what enables Python to find it is:
>>
>> PythonPath "sys.path+['/path/to/mysite']"
>>
>> I don't know much about Falcon though, sorry.
>>
>> Regards,
>>
>> Grisha
>>
>>
>> On Wed, Sep 23, 2015 at 2:20 PM, Dallas Brown <kdbdallas at gmail.com> wrote:
>>> Hi,
>>>
>>> I am trying to configure my Apache/mod_python setup (Apache/2.4.16 (Unix) mod_python/3.5.0- Python/3.4.0) to work with Falcon (http://falconframework.org) and I am following the steps located in the modpython.org docs under the WSGI Handler section (http://modpython.org/live/current/doc-html/handlers.html#wsgi-handler).
>>>
>>> I can’t get any of that section to work, and frankly it doesn’t really make sense.
>>> For example you are making the file named wsgi.py but then in the config you call mysite.wsgi which has never been mentioned anywhere, so I am not sure what it is supposed to be. It almost seems like a typo, however trying wsgi.py on my server didn’t work either.
>>>
>>> Has anyone ever used Falcon with mod_python before?
>>>
>>> Any help would be very appreciative.
>>>
>>> -Dallas
>>>
>>>
>>> _______________________________________________
>>> mod_python mailing list
>>> mod_python at modpython.org
>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>
More information about the mod_python
mailing list