Skip to content

Commit

Permalink
Merge branch 'master' of https://gitee.com/bukun/TorCMS
Browse files Browse the repository at this point in the history
  • Loading branch information
bukun committed Nov 29, 2024
2 parents f26ac7b + 9901982 commit 63c591e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions djadmin/create_django_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ def edit_postgresql():
name varchar(50)
);
""")

cur.execute("SELECT * FROM django_site;")
res = cur.fetchall()
print('====')
print(res)
# 向表中添加一条信息
cur.execute("INSERT INTO django_site(id, domain, name) VALUES (1, 'htt', 'hta')", )
if not res:
cur.execute("INSERT INTO django_site(id, domain, name) VALUES (1, 'htt', 'hta')", )

# 提交事务
conn.commit()
Expand All @@ -56,4 +60,4 @@ def edit_postgresql():
cur.close()
conn.close()
if __name__ == '__main__':
edit_postgresql()
edit_sqlite()

0 comments on commit 63c591e

Please sign in to comment.