Why is django manage.py syncdb failing to create n

2019-07-11 04:59发布

I am trying to create a development server from a production server from which I can test out new ideas.

I created a duplicate of my production server's database by dumping it using Postgres' db_dump and then imported the dump into a new database.

I then copied my production django directory and altered all .py files to refer to server_debug. rather than server in my import statements.

Using the admin interface to alter some data works in that only the development server has its data altered.

However, when I then try adding a new field in my models.py in my development server, manage.py syncdb fails to create it.

Is there something I am neglecting that could cause manage.py to refer to my production server rather than my development server?

1条回答
老娘就宠你
2楼-- · 2019-07-11 05:18

syncdb doesn't touch tables that already exist. You need to either reset the app (easiest if you don't care about the data), modify the table manually (more of a quick hack) or use a migration app and version your models — South, for example.

查看更多
登录 后发表回答