擅长:python、mysql、java
<p>在django文档中<a href="https://docs.djangoproject.com/en/1.6/topics/db/multi-db/#manually-selecting-a-database" rel="nofollow">multi-db (manually-selecting-a-database)</a></p>
<pre><code># This will run on the 'default' database.
Author.objects.all()
# So will this.
Author.objects.using('default').all()
# This will run on the 'other' database.
Author.objects.using('other').all()
The 'default' and 'other' are aliases for you databases.
In your case it would could be 'default' and 'remote'.
</code></pre>
<p>当然,您可以用您想要的任何东西替换.all()。在</p>
^{pr2}$