0

我正在使用基于 python 2.7 构建的单页 Web 应用程序。我需要添加一个简单的身份验证页面,其中包含用户名、密码和登录按钮,该按钮将重定向到应用程序。此外,应用程序页面中的注销按钮将重定向到登录页面。它将使用将与相关用户共享的单个用户名和密码。它使用 wsgiref

from wsgiref import simple_server

from someApp import SomeAPI

app = SomeAPI()

if __name__ == '__main__':

    httpd = simple_server.make_server('0.0.0.0', 8000, app)
    httpd.serve_forever()

我正在尝试使用一些中间件身份验证,例如 falcon-auth 或 bucket 。安装时出现错误。

C:\Users\User1>pip install falcon-auth
Collecting falcon-auth
c:\python27\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning

我终于得到了错误

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping

鉴于我需要使用 Python 2.7 而不是升级到更高版本,有什么解决方案

4

0 回答 0