擅长:python、mysql、java
<p>我认为你应该改变这部分:</p>
<pre><code>if request.method == 'POST' or request.method == 'PUT':
</code></pre>
<p>为了更好的实践,我认为你应该:</p>
<pre><code>if request.method == 'POST' or request.method == 'PUT':
# do your code here, which edit into your database
if request.method == 'GET':
# do GET code here, which return data from your database
</code></pre>
<p>或者将https方法分成不同的函数</p>