{"id":1072000,"date":"2025-01-08T11:12:18","date_gmt":"2025-01-08T03:12:18","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1072000.html"},"modified":"2025-01-08T11:12:21","modified_gmt":"2025-01-08T03:12:21","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e8%bf%9e%e6%8e%a5%e6%95%b0%e6%8d%ae%e5%ba%93-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1072000.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u8fde\u63a5\u6570\u636e\u5e93"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25102339\/6be493b7-e602-4ad0-ba7e-03f683e0dce4.webp\" alt=\"python\u4e2d\u5982\u4f55\u8fde\u63a5\u6570\u636e\u5e93\" \/><\/p>\n<p><p> <strong>Python\u4e2d\u8fde\u63a5\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff1a\u4f7f\u7528SQLite\u3001\u4f7f\u7528MySQL\u3001\u4f7f\u7528PostgreSQL\u3001\u4f7f\u7528SQLAlchemy\u3002<\/strong>  <\/p>\n<\/p>\n<p><p>\u5728\u6570\u636e\u5e93\u7f16\u7a0b\u4e2d\uff0c\u4e00\u4e2a\u5e38\u89c1\u7684\u9700\u6c42\u662f\u4ecePython\u7a0b\u5e8f\u4e2d\u8fde\u63a5\u5230\u6570\u636e\u5e93\uff0c\u5e76\u6267\u884c\u4e00\u4e9bSQL\u67e5\u8be2\u3002Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u5f0f\u6765\u8fde\u63a5\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u5e93\u3002\u4ee5\u4e0b\u662f\u8fd9\u4e9b\u65b9\u6cd5\u7684\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528SQLite<\/p>\n<\/p>\n<p><p>SQLite\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u3001\u5d4c\u5165\u5f0f\u7684SQL\u6570\u636e\u5e93\u5f15\u64ce\uff0c\u9002\u7528\u4e8e\u5c0f\u578b\u5e94\u7528\u7a0b\u5e8f\u6216\u5f00\u53d1\u9636\u6bb5\u7684\u6d4b\u8bd5\u3002\u5b83\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\u65e0\u9700\u5b89\u88c5\u4efb\u4f55\u989d\u5916\u7684\u5e93\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sqlite3<\/p>\n<p>def connect_to_sqlite(db_name):<\/p>\n<p>    try:<\/p>\n<p>        conn = sqlite3.connect(db_name)<\/p>\n<p>        print(&quot;Successfully connected to SQLite&quot;)<\/p>\n<p>        return conn<\/p>\n<p>    except sqlite3.Error as error:<\/p>\n<p>        print(&quot;Error while connecting to SQLite&quot;, error)<\/p>\n<p>def create_table(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS users (<\/p>\n<p>                      id INTEGER PRIMARY KEY,<\/p>\n<p>                      name TEXT NOT NULL,<\/p>\n<p>                      age INTEGER NOT NULL);&#39;&#39;&#39;)<\/p>\n<p>    conn.commit()<\/p>\n<p>def insert_data(conn, name, age):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;INSERT INTO users (name, age) VALUES (?, ?)&quot;, (name, age))<\/p>\n<p>    conn.commit()<\/p>\n<p>def query_data(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;SELECT * FROM users&quot;)<\/p>\n<p>    rows = cursor.fetchall()<\/p>\n<p>    for row in rows:<\/p>\n<p>        print(row)<\/p>\n<p>if __name__ == &quot;__m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n__&quot;:<\/p>\n<p>    conn = connect_to_sqlite(&quot;test.db&quot;)<\/p>\n<p>    create_table(conn)<\/p>\n<p>    insert_data(conn, &#39;John Doe&#39;, 29)<\/p>\n<p>    query_data(conn)<\/p>\n<p>    conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>SQLite\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u96f6\u914d\u7f6e\u3001\u8f7b\u91cf\u7ea7\u548c\u5d4c\u5165\u5f0f\uff0c\u4f46\u5b83\u4e0d\u9002\u7528\u4e8e\u5927\u578b\u5e94\u7528\u7a0b\u5e8f\u6216\u9ad8\u5e76\u53d1\u8bbf\u95ee\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528MySQL<\/p>\n<\/p>\n<p><p>MySQL\u662f\u4e00\u79cd\u6d41\u884c\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u5e7f\u6cdb\u7528\u4e8e\u5404\u79cd\u5e94\u7528\u7a0b\u5e8f\u3002\u8981\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93\uff0c\u4f60\u9700\u8981\u5b89\u88c5<code>mysql-connector-python<\/code>\u6216<code>pymysql<\/code>\u5e93\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528mysql-connector-python\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import mysql.connector<\/p>\n<p>def connect_to_mysql(host, user, password, database):<\/p>\n<p>    try:<\/p>\n<p>        conn = mysql.connector.connect(<\/p>\n<p>            host=host,<\/p>\n<p>            user=user,<\/p>\n<p>            password=password,<\/p>\n<p>            database=database<\/p>\n<p>        )<\/p>\n<p>        print(&quot;Successfully connected to MySQL&quot;)<\/p>\n<p>        return conn<\/p>\n<p>    except mysql.connector.Error as error:<\/p>\n<p>        print(&quot;Error while connecting to MySQL&quot;, error)<\/p>\n<p>def create_table(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS users (<\/p>\n<p>                      id INT AUTO_INCREMENT PRIMARY KEY,<\/p>\n<p>                      name VARCHAR(255) NOT NULL,<\/p>\n<p>                      age INT NOT NULL);&#39;&#39;&#39;)<\/p>\n<p>    conn.commit()<\/p>\n<p>def insert_data(conn, name, age):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;INSERT INTO users (name, age) VALUES (%s, %s)&quot;, (name, age))<\/p>\n<p>    conn.commit()<\/p>\n<p>def query_data(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;SELECT * FROM users&quot;)<\/p>\n<p>    rows = cursor.fetchall()<\/p>\n<p>    for row in rows:<\/p>\n<p>        print(row)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    conn = connect_to_mysql(&quot;localhost&quot;, &quot;root&quot;, &quot;password&quot;, &quot;test_db&quot;)<\/p>\n<p>    create_table(conn)<\/p>\n<p>    insert_data(conn, &#39;Jane Doe&#39;, 25)<\/p>\n<p>    query_data(conn)<\/p>\n<p>    conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528PyMySQL\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import pymysql<\/p>\n<p>def connect_to_mysql(host, user, password, database):<\/p>\n<p>    try:<\/p>\n<p>        conn = pymysql.connect(<\/p>\n<p>            host=host,<\/p>\n<p>            user=user,<\/p>\n<p>            password=password,<\/p>\n<p>            database=database<\/p>\n<p>        )<\/p>\n<p>        print(&quot;Successfully connected to MySQL&quot;)<\/p>\n<p>        return conn<\/p>\n<p>    except pymysql.MySQLError as error:<\/p>\n<p>        print(&quot;Error while connecting to MySQL&quot;, error)<\/p>\n<p>def create_table(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS users (<\/p>\n<p>                      id INT AUTO_INCREMENT PRIMARY KEY,<\/p>\n<p>                      name VARCHAR(255) NOT NULL,<\/p>\n<p>                      age INT NOT NULL);&#39;&#39;&#39;)<\/p>\n<p>    conn.commit()<\/p>\n<p>def insert_data(conn, name, age):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;INSERT INTO users (name, age) VALUES (%s, %s)&quot;, (name, age))<\/p>\n<p>    conn.commit()<\/p>\n<p>def query_data(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;SELECT * FROM users&quot;)<\/p>\n<p>    rows = cursor.fetchall()<\/p>\n<p>    for row in rows:<\/p>\n<p>        print(row)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    conn = connect_to_mysql(&quot;localhost&quot;, &quot;root&quot;, &quot;password&quot;, &quot;test_db&quot;)<\/p>\n<p>    create_table(conn)<\/p>\n<p>    insert_data(conn, &#39;Jane Doe&#39;, 25)<\/p>\n<p>    query_data(conn)<\/p>\n<p>    conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528PostgreSQL<\/p>\n<\/p>\n<p><p>PostgreSQL\u662f\u4e00\u79cd\u529f\u80fd\u5f3a\u5927\u7684\u5f00\u6e90\u5bf9\u8c61\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5177\u6709\u9ad8\u6269\u5c55\u6027\u548c\u6807\u51c6\u5408\u89c4\u6027\u3002\u8981\u8fde\u63a5\u5230PostgreSQL\u6570\u636e\u5e93\uff0c\u4f60\u9700\u8981\u5b89\u88c5<code>psycopg2<\/code>\u5e93\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import psycopg2<\/p>\n<p>def connect_to_postgresql(host, user, password, database):<\/p>\n<p>    try:<\/p>\n<p>        conn = psycopg2.connect(<\/p>\n<p>            host=host,<\/p>\n<p>            user=user,<\/p>\n<p>            password=password,<\/p>\n<p>            database=database<\/p>\n<p>        )<\/p>\n<p>        print(&quot;Successfully connected to PostgreSQL&quot;)<\/p>\n<p>        return conn<\/p>\n<p>    except psycopg2.Error as error:<\/p>\n<p>        print(&quot;Error while connecting to PostgreSQL&quot;, error)<\/p>\n<p>def create_table(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS users (<\/p>\n<p>                      id SERIAL PRIMARY KEY,<\/p>\n<p>                      name VARCHAR(255) NOT NULL,<\/p>\n<p>                      age INT NOT NULL);&#39;&#39;&#39;)<\/p>\n<p>    conn.commit()<\/p>\n<p>def insert_data(conn, name, age):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;INSERT INTO users (name, age) VALUES (%s, %s)&quot;, (name, age))<\/p>\n<p>    conn.commit()<\/p>\n<p>def query_data(conn):<\/p>\n<p>    cursor = conn.cursor()<\/p>\n<p>    cursor.execute(&quot;SELECT * FROM users&quot;)<\/p>\n<p>    rows = cursor.fetchall()<\/p>\n<p>    for row in rows:<\/p>\n<p>        print(row)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    conn = connect_to_postgresql(&quot;localhost&quot;, &quot;postgres&quot;, &quot;password&quot;, &quot;test_db&quot;)<\/p>\n<p>    create_table(conn)<\/p>\n<p>    insert_data(conn, &#39;John Smith&#39;, 35)<\/p>\n<p>    query_data(conn)<\/p>\n<p>    conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528SQLAlchemy<\/p>\n<\/p>\n<p><p>SQLAlchemy\u662f\u4e00\u4e2aPython SQL\u5de5\u5177\u5305\u548c\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\uff08ORM\uff09\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5168\u529f\u80fd\u7684\u4f01\u4e1a\u7ea7\u6301\u4e45\u6a21\u578b\u3002\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528Python\u5bf9\u8c61\u64cd\u4f5c\u6570\u636e\u5e93\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u7f16\u5199SQL\u8bed\u53e5\u3002SQLAlchemy\u652f\u6301\u591a\u79cd\u6570\u636e\u5e93\uff0c\u5305\u62ecSQLite\u3001MySQL\u3001PostgreSQL\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sqlalchemy import create_engine, Column, Integer, String<\/p>\n<p>from sqlalchemy.ext.declarative import declarative_base<\/p>\n<p>from sqlalchemy.orm import sessionmaker<\/p>\n<p>Base = declarative_base()<\/p>\n<p>class User(Base):<\/p>\n<p>    __tablename__ = &#39;users&#39;<\/p>\n<p>    id = Column(Integer, primary_key=True, autoincrement=True)<\/p>\n<p>    name = Column(String, nullable=False)<\/p>\n<p>    age = Column(Integer, nullable=False)<\/p>\n<p>def connect_to_database(uri):<\/p>\n<p>    try:<\/p>\n<p>        engine = create_engine(uri)<\/p>\n<p>        Base.metadata.create_all(engine)<\/p>\n<p>        print(&quot;Successfully connected to the database&quot;)<\/p>\n<p>        return engine<\/p>\n<p>    except Exception as error:<\/p>\n<p>        print(&quot;Error while connecting to the database&quot;, error)<\/p>\n<p>def insert_data(engine, name, age):<\/p>\n<p>    Session = sessionmaker(bind=engine)<\/p>\n<p>    session = Session()<\/p>\n<p>    new_user = User(name=name, age=age)<\/p>\n<p>    session.add(new_user)<\/p>\n<p>    session.commit()<\/p>\n<p>def query_data(engine):<\/p>\n<p>    Session = sessionmaker(bind=engine)<\/p>\n<p>    session = Session()<\/p>\n<p>    users = session.query(User).all()<\/p>\n<p>    for user in users:<\/p>\n<p>        print(user.id, user.name, user.age)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    engine = connect_to_database(&quot;sqlite:\/\/\/test.db&quot;)<\/p>\n<p>    insert_data(engine, &#39;Alice&#39;, 28)<\/p>\n<p>    query_data(engine)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u603b\u7ed3<\/strong><\/p>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u5f0f\u8fde\u63a5\u548c\u64cd\u4f5c\u6570\u636e\u5e93\uff0c\u5305\u62ecSQLite\u3001MySQL\u3001PostgreSQL\u548cSQLAlchemy\u7b49\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u9002\u7528\u7684\u573a\u666f\u548c\u4f18\u52bf\u3002SQLite\u9002\u7528\u4e8e\u5c0f\u578b\u5e94\u7528\u548c\u5f00\u53d1\u6d4b\u8bd5\uff0cMySQL\u548cPostgreSQL\u9002\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u4e0b\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u64cd\u4f5c\uff0cSQLAlchemy\u5219\u63d0\u4f9b\u4e86ORM\u652f\u6301\uff0c\u7b80\u5316\u4e86\u6570\u636e\u5e93\u64cd\u4f5c\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u5e93\u548c\u8fde\u63a5\u65b9\u5f0f\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u5347\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u9002\u5408\u7684\u6570\u636e\u5e93\u4e0ePython\u8fde\u63a5\uff1f<\/strong><br \/>\u5728\u9009\u62e9\u6570\u636e\u5e93\u65f6\uff0c\u9700\u8981\u8003\u8651\u6570\u636e\u7684\u7ed3\u6784\u3001\u8bbf\u95ee\u9891\u7387\u548c\u5e76\u53d1\u9700\u6c42\u3002\u5e38\u89c1\u7684\u6570\u636e\u5e93\u5305\u62ecMySQL\u3001PostgreSQL\u3001SQLite\u548cMongoDB\u7b49\u3002\u6bcf\u79cd\u6570\u636e\u5e93\u90fd\u6709\u5176\u7279\u5b9a\u7684Python\u5e93\uff0c\u4f8b\u5982\uff0c\u4f7f\u7528<code>mysql-connector-python<\/code>\u8fde\u63a5MySQL\uff0c<code>psycopg2<\/code>\u8fde\u63a5PostgreSQL\uff0c\u6216\u8005\u4f7f\u7528<code>sqlite3<\/code>\u6a21\u5757\u8fde\u63a5SQLite\u3002\u4e86\u89e3\u5404\u4e2a\u6570\u636e\u5e93\u7684\u7279\u70b9\u548c\u9002\u7528\u573a\u666f\u53ef\u4ee5\u5e2e\u52a9\u60a8\u505a\u51fa\u660e\u667a\u7684\u9009\u62e9\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u8fde\u63a5\u6570\u636e\u5e93\u65f6\u9700\u8981\u5b89\u88c5\u54ea\u4e9b\u5e93\uff1f<\/strong><br \/>\u8fde\u63a5\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u5e93\u9700\u8981\u5b89\u88c5\u76f8\u5e94\u7684\u6570\u636e\u5e93\u9a71\u52a8\u7a0b\u5e8f\u3002\u5bf9\u4e8eMySQL\uff0c\u901a\u5e38\u9700\u8981\u5b89\u88c5<code>mysql-connector-python<\/code>\u6216<code>PyMySQL<\/code>\uff1b\u5bf9\u4e8ePostgreSQL\uff0c\u63a8\u8350\u4f7f\u7528<code>psycopg2<\/code>\uff1b\u800cSQLite\u5219\u5df2\u7ecf\u5185\u7f6e\u4e8ePython\u6807\u51c6\u5e93\u4e2d\uff0c\u65e0\u9700\u989d\u5916\u5b89\u88c5\u3002\u5b89\u88c5\u5e93\u7684\u65b9\u5f0f\u901a\u5e38\u662f\u901a\u8fc7<code>pip<\/code>\u547d\u4ee4\uff0c\u4f8b\u5982\uff1a<code>pip install mysql-connector-python<\/code>\u3002<\/p>\n<p><strong>\u5728\u8fde\u63a5\u6570\u636e\u5e93\u65f6\uff0c\u5982\u4f55\u5904\u7406\u8fde\u63a5\u5f02\u5e38\uff1f<\/strong><br \/>\u5728\u4e0e\u6570\u636e\u5e93\u5efa\u7acb\u8fde\u63a5\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u5f02\u5e38\u60c5\u51b5\uff0c\u5982\u7f51\u7edc\u95ee\u9898\u3001\u8ba4\u8bc1\u5931\u8d25\u6216\u6570\u636e\u5e93\u670d\u52a1\u672a\u542f\u52a8\u3002\u4e3a\u4e86\u786e\u4fdd\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528<code>try...except<\/code>\u8bed\u53e5\u6355\u83b7\u8fd9\u4e9b\u5f02\u5e38\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u6355\u83b7<code>OperationalError<\/code>\u6765\u5904\u7406\u8fde\u63a5\u5931\u8d25\u7684\u95ee\u9898\uff0c\u5e76\u63d0\u4f9b\u7528\u6237\u53cb\u597d\u7684\u9519\u8bef\u4fe1\u606f\u6216\u91cd\u8bd5\u673a\u5236\u3002\u8fd9\u6837\u4e0d\u4ec5\u80fd\u63d0\u9ad8\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\uff0c\u8fd8\u80fd\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u4e2d\u8fde\u63a5\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff1a\u4f7f\u7528SQLite\u3001\u4f7f\u7528MySQL\u3001\u4f7f\u7528PostgreSQL\u3001\u4f7f\u7528SQLA [&hellip;]","protected":false},"author":3,"featured_media":1072008,"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\/1072000"}],"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=1072000"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1072000\/revisions"}],"predecessor-version":[{"id":1072012,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1072000\/revisions\/1072012"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1072008"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1072000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1072000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1072000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}