On 12 February 2011 17:36, strattonbrazil <strattonbra...@gmail.com> wrote:
> I'm having a problem getting web.py's OpenID working with mod_wsgi. If
> I run web.py's webser directly, it works, so I'm guessing it's not a
> problem with my code but how apache/mod_wsgi stores files.  When I run
> the web.py server directly, the openid library will create
> a .openid_secret_key file.  If this file doesn't exist or gets deleted
> by the next request, everyone is "logged out" and the file gets
> recreated.  I can't confirm this is the problem, but I was wondering
> if anyone had any reason why storing an encryption store as a file
> would work with web.py but not with mod_wsgi.  Running the code, the
> key file isn't being created in my cgi-bin.  Where would file reads/
> writes go to?
>
> Here's an example I pulled from 
> http://log.liminastudio.com/programming/howto-use-openid-with-web-py.
> It works when I run this locally, but doesn't using mod_wsgi.  The
> only difference I can imagine is this file write.  Can anyone get this
> example to run correctly with mod_wsgi?
>
> import web, web.webopenid
>
> urls = (
>    r'/openid', 'web.webopenid.host',
>    r'/', 'Index'
> )
>
> app = web.application(urls, globals())
>
> class Index:
>    def GET(self):
>        body = '''
>        <html><head><title>Web.py OpenID Test</title></head>
>        <body>
>            %s
>        </body>
>        </html>
>        ''' % (web.webopenid.form('/openid'))
>
>        return body
>
> if __name__ == "__main__": app.run()

A few points to note.

Apache processes run as a special user and may not have ability to
read/write to the required directory.

The current working directory of an Apache process is NOT the
directory of the script file and you therefore cannot use relative
paths but must use absolute paths.

Apache/mod_wsgi can run in a multi process and/or multi thread
configuration and distinct processes/threads may be interfering with
each other.

Have a read of:

  http://code.google.com/p/modwsgi/wiki/ApplicationIssues

for more detail on these sorts of issues.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to modwsgi@googlegroups.com.
To unsubscribe from this group, send email to 
modwsgi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to