質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top