{"id":962980,"date":"2024-12-27T04:13:26","date_gmt":"2024-12-26T20:13:26","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/962980.html"},"modified":"2024-12-27T04:13:28","modified_gmt":"2024-12-26T20:13:28","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e5%85%b1%e4%ba%ab%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/962980.html","title":{"rendered":"\u5982\u4f55\u7528python\u5171\u4eab\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24180519\/26c562a1-1d1a-4fca-acff-9c26df3ec98b.webp\" alt=\"\u5982\u4f55\u7528python\u5171\u4eab\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u5171\u4eab\u6587\u4ef6\u7684\u65b9\u6cd5\u5305\u62ec\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668\u3001\u4f7f\u7528FTP\u534f\u8bae\u3001\u501f\u52a9\u7b2c\u4e09\u65b9\u5e93\u5982Flask\u6216Django\u3001\u4ee5\u53ca\u901a\u8fc7\u4e91\u5b58\u50a8API\u8fdb\u884c\u5171\u4eab\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5404\u6709\u4f18\u52a3\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u9009\u62e9\u3002<\/strong> \u5176\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668\u662f\u6700\u57fa\u7840\u4e14\u5feb\u901f\u7684\u65b9\u6cd5\uff0c\u9002\u5408\u5c0f\u578b\u4e34\u65f6\u7684\u6587\u4ef6\u5171\u4eab\u9700\u6c42\u3002\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u51e0\u884cPython\u4ee3\u7801\uff0c\u4f60\u53ef\u4ee5\u5feb\u901f\u5730\u5728\u5c40\u57df\u7f51\u5185\u5171\u4eab\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001HTTP\u670d\u52a1\u5668\u5171\u4eab\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>Python\u81ea\u5e26\u7684<code>http.server<\/code>\u6a21\u5757\u53ef\u4ee5\u5feb\u901f\u542f\u52a8\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668\uff0c\u8fd9\u662f\u5b9e\u73b0\u6587\u4ef6\u5171\u4eab\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h4>1. \u57fa\u672c\u7528\u6cd5<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Python\u5185\u7f6e\u7684HTTP\u670d\u52a1\u5668\u53ef\u4ee5\u5728\u51e0\u4e4e\u6ca1\u6709\u4efb\u4f55\u989d\u5916\u914d\u7f6e\u7684\u60c5\u51b5\u4e0b\u5171\u4eab\u6587\u4ef6\u3002\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u5bfc\u822a\u5230\u4f60\u60f3\u8981\u5171\u4eab\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m http.server 8000<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u542f\u52a8\u4e00\u4e2aHTTP\u670d\u52a1\u5668\uff0c\u76d1\u542c8000\u7aef\u53e3\u3002\u5176\u4ed6\u8bbe\u5907\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee<code>http:\/\/&lt;\u4f60\u7684IP\u5730\u5740&gt;:8000<\/code>\u6765\u6d4f\u89c8\u548c\u4e0b\u8f7d\u5171\u4eab\u7684\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>2. \u5b89\u5168\u6027\u548c\u5c40\u9650\u6027<\/h4>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u6613\u7528\uff0c\u4f46\u7f3a\u4e4f\u5b89\u5168\u6027\u3002\u5b83\u4e0d\u63d0\u4f9b\u4efb\u4f55\u8ba4\u8bc1\u548c\u52a0\u5bc6\u673a\u5236\uff0c\u9002\u5408\u4e8e\u53d7\u4fe1\u4efb\u7684\u5c40\u57df\u7f51\u73af\u5883\u4e2d\u4f7f\u7528\u3002\u82e5\u9700\u8981\u5728\u516c\u7f51\u6216\u4e0d\u5b89\u5168\u7684\u7f51\u7edc\u4e2d\u4f7f\u7528\uff0c\u5efa\u8bae\u6dfb\u52a0\u989d\u5916\u7684\u5b89\u5168\u63aa\u65bd\uff0c\u6bd4\u5982\u4f7f\u7528VPN\u6216\u8005\u5728HTTP\u670d\u52a1\u5668\u4e4b\u524d\u52a0\u4e00\u5c42\u4ee3\u7406\u670d\u52a1\u5668\u6765\u5904\u7406SSL\/TLS\u52a0\u5bc6\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528FTP\u534f\u8bae\u5171\u4eab\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>FTP\uff08\u6587\u4ef6\u4f20\u8f93\u534f\u8bae\uff09\u662f\u4e00\u79cd\u5728\u7f51\u7edc\u4e2d\u5171\u4eab\u6587\u4ef6\u7684\u4f20\u7edf\u65b9\u6cd5\u3002Python\u63d0\u4f9b\u4e86<code>pyftpdlib<\/code>\u5e93\uff0c\u4f7f\u5f97\u521b\u5efaFTP\u670d\u52a1\u5668\u53d8\u5f97\u7b80\u5355\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5\u5e76\u542f\u52a8FTP\u670d\u52a1\u5668<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5<code>pyftpdlib<\/code>\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pyftpdlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u5728\u6307\u5b9a\u76ee\u5f55\u4e2d\u542f\u52a8FTP\u670d\u52a1\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyftpdlib.authorizers import DummyAuthorizer<\/p>\n<p>from pyftpdlib.handlers import FTPHandler<\/p>\n<p>from pyftpdlib.servers import FTPServer<\/p>\n<p>def start_ftp_server():<\/p>\n<p>    authorizer = DummyAuthorizer()<\/p>\n<p>    authorizer.add_user(&quot;user&quot;, &quot;12345&quot;, &quot;\/path\/to\/your\/share&quot;, perm=&quot;elradfmw&quot;)<\/p>\n<p>    authorizer.add_anonymous(&quot;\/path\/to\/your\/share&quot;, perm=&quot;elradfmw&quot;)<\/p>\n<p>    handler = FTPHandler<\/p>\n<p>    handler.authorizer = authorizer<\/p>\n<p>    server = FTPServer((&quot;0.0.0.0&quot;, 21), handler)<\/p>\n<p>    server.serve_forever()<\/p>\n<p>start_ftp_server()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4e2aFTP\u670d\u52a1\u5668\uff0c\u5e76\u5141\u8bb8\u7528\u6237\u548c\u533f\u540d\u7528\u6237\u8bbf\u95ee\u6307\u5b9a\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><h4>2. \u5b89\u5168\u6027\u4e0e\u7528\u6237\u7ba1\u7406<\/h4>\n<\/p>\n<p><p>FTP\u534f\u8bae\u672c\u8eab\u4e0d\u5b89\u5168\uff0c\u6570\u636e\u4f20\u8f93\u662f\u660e\u6587\u7684\u3002\u56e0\u6b64\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u5e94\u4f7f\u7528FTPS\uff08FTP Secure\uff09\u6216SFTP\uff08SSH File Transfer Protocol\uff09\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u4f20\u8f93\u7684\u5b89\u5168\u6027\u3002\u6b64\u5916\uff0c\u5408\u7406\u7684\u7528\u6237\u7ba1\u7406\u548c\u6743\u9650\u8bbe\u7f6e\u4e5f\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u5229\u7528Flask\u6216Django\u8fdb\u884c\u6587\u4ef6\u5171\u4eab<\/h3>\n<\/p>\n<p><p>Flask\u548cDjango\u662f\u4e24\u4e2a\u6d41\u884c\u7684Python web\u6846\u67b6\uff0c\u53ef\u4ee5\u7528\u6765\u6784\u5efa\u529f\u80fd\u66f4\u4e30\u5bcc\u7684\u6587\u4ef6\u5171\u4eab\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528Flask\u5171\u4eab\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>Flask\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684web\u6846\u67b6\uff0c\u9002\u5408\u5feb\u901f\u5f00\u53d1\u548c\u90e8\u7f72\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Flask\u5b9e\u73b0\u6587\u4ef6\u5171\u4eab\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask, send_from_directory<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/files\/&lt;path:filename&gt;&#39;)<\/p>\n<p>def download_file(filename):<\/p>\n<p>    return send_from_directory(&#39;\/path\/to\/your\/share&#39;, filename)<\/p>\n<p>if __name__ == &#39;__m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n__&#39;:<\/p>\n<p>    app.run(host=&#39;0.0.0.0&#39;, port=5000)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u7b80\u5355\u7684Flask\u5e94\u7528\u5141\u8bb8\u7528\u6237\u901a\u8fc7HTTP\u8bf7\u6c42\u4e0b\u8f7d\u6307\u5b9a\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528Django\u5171\u4eab\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>Django\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684web\u6846\u67b6\uff0c\u9002\u5408\u6784\u5efa\u590d\u6742\u7684web\u5e94\u7528\u3002\u867d\u7136\u8bbe\u7f6e\u8f83\u4e3a\u590d\u6742\uff0c\u4f46\u53ef\u4ee5\u63d0\u4f9b\u66f4\u591a\u7684\u529f\u80fd\u548c\u5b89\u5168\u4fdd\u969c\u3002<\/p>\n<\/p>\n<p><p>\u5728Django\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u81ea\u5e26\u7684<code>FileResponse<\/code>\u6765\u5904\u7406\u6587\u4ef6\u4e0b\u8f7d\u8bf7\u6c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from django.http import FileResponse<\/p>\n<p>def download_file(request, filename):<\/p>\n<p>    filepath = &#39;\/path\/to\/your\/share\/&#39; + filename<\/p>\n<p>    return FileResponse(open(filepath, &#39;rb&#39;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06\u6b64\u89c6\u56fe\u5173\u8054\u5230\u4e00\u4e2aURL\uff0c\u5e76\u5728Django\u9879\u76ee\u4e2d\u914d\u7f6e\u597d\u8def\u7531\u540e\uff0c\u5373\u53ef\u5b9e\u73b0\u6587\u4ef6\u5171\u4eab\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u901a\u8fc7\u4e91\u5b58\u50a8API\u5171\u4eab\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u73b0\u4ee3\u4e91\u5b58\u50a8\u670d\u52a1\u5982AWS S3\u3001Google Cloud Storage\u3001Dropbox\u7b49\u63d0\u4f9b\u4e86API\u63a5\u53e3\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u8f7b\u677e\u5730\u4e0a\u4f20\u3001\u4e0b\u8f7d\u548c\u5171\u4eab\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528AWS S3\u5171\u4eab\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>AWS S3\u662f\u4e00\u4e2a\u9ad8\u5ea6\u53ef\u6269\u5c55\u548c\u5b89\u5168\u7684\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\uff0c\u9002\u5408\u5b58\u50a8\u548c\u5171\u4eab\u5927\u91cf\u6587\u4ef6\u3002\u4f7f\u7528Boto3\u5e93\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0eS3\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u5b89\u88c5Boto3\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install boto3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u4e0a\u4f20\u548c\u5171\u4eab\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import boto3<\/p>\n<p>from botocore.exceptions import NoCredentialsError<\/p>\n<p>def upload_to_s3(file_name, bucket, object_name=None):<\/p>\n<p>    s3_client = boto3.client(&#39;s3&#39;)<\/p>\n<p>    try:<\/p>\n<p>        s3_client.upload_file(file_name, bucket, object_name or file_name)<\/p>\n<p>        print(f&quot;File {file_name} uploaded successfully.&quot;)<\/p>\n<p>    except NoCredentialsError:<\/p>\n<p>        print(&quot;Credentials not available.&quot;)<\/p>\n<p>upload_to_s3(&#39;test.txt&#39;, &#39;my-bucket&#39;, &#39;test.txt&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6587\u4ef6\u4e0a\u4f20\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u751f\u6210\u7684URL\u6216API\u63a5\u53e3\u8fdb\u884c\u8bbf\u95ee\u548c\u5171\u4eab\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528Google Cloud Storage\u5171\u4eab\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>Google Cloud Storage\u7c7b\u4f3c\u4e8eAWS S3\uff0c\u4e5f\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684API\u63a5\u53e3\u3002<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Google Cloud Storage\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install google-cloud-storage<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4e0a\u4f20\u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from google.cloud import storage<\/p>\n<p>def upload_to_gcs(bucket_name, source_file_name, destination_blob_name):<\/p>\n<p>    storage_client = storage.Client()<\/p>\n<p>    bucket = storage_client.bucket(bucket_name)<\/p>\n<p>    blob = bucket.blob(destination_blob_name)<\/p>\n<p>    blob.upload_from_filename(source_file_name)<\/p>\n<p>    print(f&quot;File {source_file_name} uploaded to {destination_blob_name}.&quot;)<\/p>\n<p>upload_to_gcs(&#39;my-bucket&#39;, &#39;test.txt&#39;, &#39;test.txt&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0eAWS S3\u7c7b\u4f3c\uff0c\u4e0a\u4f20\u540e\u53ef\u4ee5\u751f\u6210\u5171\u4eab\u94fe\u63a5\uff0c\u5141\u8bb8\u7528\u6237\u4e0b\u8f7d\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u7ed3\u8bba<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Python\u8fdb\u884c\u6587\u4ef6\u5171\u4eab\u6709\u591a\u79cd\u9014\u5f84\uff0c\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u9002\u7528\u7684\u573a\u666f\u548c\u4f18\u7f3a\u70b9\u3002\u5bf9\u4e8e\u5c0f\u89c4\u6a21\u3001\u4e34\u65f6\u7684\u6587\u4ef6\u5171\u4eab\uff0c\u4f7f\u7528Python\u5185\u7f6e\u7684HTTP\u670d\u52a1\u5668\u662f\u6700\u7b80\u5355\u7684\u9009\u62e9\uff1b\u5bf9\u4e8e\u9700\u8981\u66f4\u9ad8\u5b89\u5168\u6027\u548c\u7ba1\u7406\u80fd\u529b\u7684\u573a\u666f\uff0cFTP\u3001Flask\u3001Django\u4ee5\u53ca\u4e91\u5b58\u50a8\u670d\u52a1\u90fd\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5f00\u53d1\u8005\u5e94\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u540c\u65f6\u6ce8\u610f\u5b89\u5168\u6027\u548c\u6027\u80fd\u4f18\u5316\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u5b9e\u73b0\u6587\u4ef6\u5171\u4eab\u7684\u57fa\u672c\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5b9e\u73b0\u6587\u4ef6\u5171\u4eab\u901a\u5e38\u6d89\u53ca\u5230\u7f51\u7edc\u7f16\u7a0b\u3002\u4f7f\u7528Python\u7684<code>socket<\/code>\u5e93\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u5ba2\u6237\u7aef-\u670d\u52a1\u5668\u67b6\u6784\u3002\u670d\u52a1\u5668\u7aef\u76d1\u542c\u7279\u5b9a\u7aef\u53e3\uff0c\u63a5\u6536\u6587\u4ef6\u8bf7\u6c42\uff0c\u800c\u5ba2\u6237\u7aef\u5219\u53ef\u4ee5\u53d1\u9001\u8bf7\u6c42\u4ee5\u83b7\u53d6\u6240\u9700\u6587\u4ef6\u3002\u9996\u5148\uff0c\u9700\u8981\u8bbe\u7f6e\u670d\u52a1\u5668\u7aef\u4ee5\u63a5\u6536\u6587\u4ef6\u5e76\u4fdd\u5b58\u5230\u6307\u5b9a\u4f4d\u7f6e\uff0c\u5176\u6b21\uff0c\u5ba2\u6237\u7aef\u901a\u8fc7\u7f51\u7edc\u8bf7\u6c42\u6587\u4ef6\u5e76\u63a5\u6536\u6570\u636e\u5e76\u4fdd\u5b58\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\uff0c\u6709\u54ea\u4e9b\u5e93\u53ef\u4ee5\u7528\u4e8e\u6587\u4ef6\u5171\u4eab\u548c\u4f20\u8f93\uff1f<\/strong><br \/>\u9664\u4e86<code>socket<\/code>\u5e93\uff0cPython\u8fd8\u63d0\u4f9b\u4e86<code>ftplib<\/code>\u7528\u4e8eFTP\u6587\u4ef6\u4f20\u8f93\uff0c<code>http.server<\/code>\u6a21\u5757\u53ef\u4ee5\u5feb\u901f\u6784\u5efaHTTP\u670d\u52a1\u5668\uff0c<code>paramiko<\/code>\u53ef\u7528\u4e8eSSH\u6587\u4ef6\u4f20\u8f93\u3002\u8fd9\u4e9b\u5e93\u5404\u6709\u7279\u70b9\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>http.server<\/code>\u53ef\u4ee5\u65b9\u4fbf\u5730\u642d\u5efa\u4e00\u4e2a\u4e34\u65f6HTTP\u670d\u52a1\u5668\u6765\u5206\u4eab\u6587\u4ef6\uff0c\u9002\u5408\u5feb\u901f\u5171\u4eab\u3002<\/p>\n<p><strong>\u5982\u4f55\u786e\u4fdd\u5728Python\u6587\u4ef6\u5171\u4eab\u4e2d\u6570\u636e\u7684\u5b89\u5168\u6027\uff1f<\/strong><br \/>\u786e\u4fdd\u6570\u636e\u5b89\u5168\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u3002\u9996\u5148\uff0c\u4f7f\u7528\u52a0\u5bc6\u534f\u8bae\uff08\u5982SSL\/TLS\uff09\u6765\u4fdd\u62a4\u4f20\u8f93\u4e2d\u7684\u6570\u636e\uff0c\u907f\u514d\u654f\u611f\u4fe1\u606f\u88ab\u7a83\u53d6\u3002\u5176\u6b21\uff0c\u53ef\u4ee5\u5728\u6587\u4ef6\u4f20\u8f93\u4e4b\u524d\u8fdb\u884c\u6570\u636e\u5b8c\u6574\u6027\u6821\u9a8c\uff0c\u6bd4\u5982\u4f7f\u7528\u54c8\u5e0c\u51fd\u6570\u6765\u9a8c\u8bc1\u6587\u4ef6\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u662f\u5426\u88ab\u7be1\u6539\u3002\u6b64\u5916\uff0c\u8bbe\u7f6e\u9002\u5f53\u7684\u6743\u9650\u548c\u8eab\u4efd\u9a8c\u8bc1\u63aa\u65bd\u53ef\u4ee5\u8fdb\u4e00\u6b65\u589e\u5f3a\u5b89\u5168\u6027\uff0c\u786e\u4fdd\u53ea\u6709\u6388\u6743\u7528\u6237\u80fd\u591f\u8bbf\u95ee\u5171\u4eab\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u5171\u4eab\u6587\u4ef6\u7684\u65b9\u6cd5\u5305\u62ec\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684HTTP\u670d\u52a1\u5668\u3001\u4f7f\u7528FTP\u534f\u8bae\u3001\u501f\u52a9\u7b2c\u4e09\u65b9\u5e93\u5982Flask\u6216Dj [&hellip;]","protected":false},"author":3,"featured_media":962987,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962980"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=962980"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962980\/revisions"}],"predecessor-version":[{"id":962988,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962980\/revisions\/962988"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/962987"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=962980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=962980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=962980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}