小编tpa*_*ott的帖子

Python MySQL 连接器不支持 SSL

我最近在我的 MySQL 服务器上配置了 SSL,它似乎破坏了我的 python 应用程序。我可以通过命令行很好地连接到服务器:

user@kiosk:~$ mysql -u <user> -p -h <remote host>
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.7.25-0ubuntu0.18.04.2 (Ubuntu)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current …
Run Code Online (Sandbox Code Playgroud)

python mysql mysql-python python-2.7

4
推荐指数
1
解决办法
2万
查看次数

BaseHTTPServer无法识别CSS文件

我正在写一个非常基本的网络服务器(好吧,尝试),虽然它现在正在提供HTML,我的CSS文件似乎根本没有被识别.我也在我的机器上运行Apache2,当我将文件复制到docroot时,页面正确提供.我也检查了权限,他们似乎没事.这是我到目前为止的代码:

class MyHandler(BaseHTTPRequestHandler):
     def do_GET(self):
           try:
                if self.path == "/":
                     self.path = "/index.html"
                if self.path == "favico.ico":
                     return
                if self.path.endswith(".html"):
                     f = open(curdir+sep+self.path)
                     self.send_response(200)
                     self.send_header('Content-type', 'text/html')
                     self.end_headers()
                     self.wfile.write(f.read())
                     f.close()
                     return
                return
            except IOError:
                self.send_error(404)
      def do_POST(self):
            ...
Run Code Online (Sandbox Code Playgroud)

为了提供CSS文件,我需要做些什么特别的事情吗?

谢谢!

python

2
推荐指数
1
解决办法
2407
查看次数

标签 统计

python ×2

mysql ×1

mysql-python ×1

python-2.7 ×1