[mod_python] Configuring Apache with mod_python for WSGI

Dallas Brown kdbdallas at gmail.com
Wed Sep 23 21:34:34 UTC 2015


Ok that makes sense, the only thing that I think I am missing is where it talks about the content being available under http://example.com/hello <http://example.com/hello> when it is talking about how you can change it to be http://example.com/wsgiapps/hello <http://example.com/wsgiapps/hello> by using the location tag. I don’t see where it was set in code or config that would specify that it would respond to /hello and in my case it doesn’t and it doesn’t respond to any other common guess I can come up with.

Thanks for your help.

-Dallas

> On Sep 23, 2015, at 1:57 PM, Grisha Trubetskoy <grisha at modpython.org> wrote:
> 
> 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
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.modpython.org/pipermail/mod_python/attachments/20150923/74d064b4/attachment.html>


More information about the mod_python mailing list