开发者

Authentication with Python, Apache, and mod_wsgi

开发者 https://www.devze.com 2023-03-12 18:44 出处:网络
I have been searching vigorously the last week in hopes of finding a solution to my problem. Originally, I had Python configured with CGI on my Windows, Apache, MySQL, and Python server. I understand

I have been searching vigorously the last week in hopes of finding a solution to my problem. Originally, I had Python configured with CGI on my Windows, Apache, MySQL, and Python server. I understand that CGI is slow and additionally drops HTTP_AUTHORIZATION headers before executing the Python environment. I have since configured mod_wsgi and added the following to my httpd.conf:

WSGIScriptAlias /flex/entry "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/flex/entry.wsgi"
WSGIPassAuthorization On

My understanding is that HT开发者_如何学CTP_AUTHORIZATION would normally now be accessible in Python via os.environ['HTTP_AUTHORIZATION']. However, this is not the case.

Can someone please explain what I am missing/doing wrong?

Thanks! Trent


It's passed in the mapping passed as environ to the main WSGI function.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号