擅长:python、mysql、java
<p>根据你对另一个答案的评论</p>
<blockquote>
<p>First version of our project is in php, we want to migrate to python-django and use the same old database. So we can't create databases again and we should configure our django project to work with existing db. </p>
</blockquote>
<p>您希望使用django中已经存在的遗留数据库。Django提供了从旧数据库(<a href="https://docs.djangoproject.com/en/1.9/howto/legacy-databases/" rel="nofollow">legacy-databases</a>)创建模型的可能性。在</p>
<p>配置旧数据库的数据库设置。然后可以运行<code>inspectdb</code>来创建旧数据库的django模型:</p>
<pre><code>python manage.py inspectdb > models.py
</code></pre>