From kdbdallas at gmail.com Wed Sep 23 18:20:32 2015 From: kdbdallas at gmail.com (Dallas Brown) Date: Wed, 23 Sep 2015 11:20:32 -0700 Subject: [mod_python] Configuring Apache with mod_python for WSGI Message-ID: <4D6D22BC-D263-44EE-BBA7-922143A52C9D@gmail.com> 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 From grisha at modpython.org Wed Sep 23 18:27:19 2015 From: grisha at modpython.org (Grisha Trubetskoy) Date: Wed, 23 Sep 2015 14:27:19 -0400 Subject: [mod_python] Configuring Apache with mod_python for WSGI In-Reply-To: <4D6D22BC-D263-44EE-BBA7-922143A52C9D@gmail.com> References: <4D6D22BC-D263-44EE-BBA7-922143A52C9D@gmail.com> Message-ID: 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 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 From kdbdallas at gmail.com Wed Sep 23 20:14:36 2015 From: kdbdallas at gmail.com (Dallas Brown) Date: Wed, 23 Sep 2015 13:14:36 -0700 Subject: [mod_python] Configuring Apache with mod_python for WSGI In-Reply-To: References: <4D6D22BC-D263-44EE-BBA7-922143A52C9D@gmail.com> Message-ID: <7B2F0F14-D2FC-4A9B-A13D-AEC5B428B422@gmail.com> 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 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 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 From grisha at modpython.org Wed Sep 23 20:57:39 2015 From: grisha at modpython.org (Grisha Trubetskoy) Date: Wed, 23 Sep 2015 16:57:39 -0400 Subject: [mod_python] Configuring Apache with mod_python for WSGI In-Reply-To: <7B2F0F14-D2FC-4A9B-A13D-AEC5B428B422@gmail.com> References: <4D6D22BC-D263-44EE-BBA7-922143A52C9D@gmail.com> <7B2F0F14-D2FC-4A9B-A13D-AEC5B428B422@gmail.com> Message-ID: 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 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 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 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 > From kdbdallas at gmail.com Wed Sep 23 21:34:34 2015 From: kdbdallas at gmail.com (Dallas Brown) Date: Wed, 23 Sep 2015 14:34:34 -0700 Subject: [mod_python] Configuring Apache with mod_python for WSGI In-Reply-To: References: <4D6D22BC-D263-44EE-BBA7-922143A52C9D@gmail.com> <7B2F0F14-D2FC-4A9B-A13D-AEC5B428B422@gmail.com> Message-ID: 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 when it is talking about how you can change it to be 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 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 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 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 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: