Django: Change models without clearing all data?

Posted by Rosarch on Stack Overflow See other posts from Stack Overflow or by Rosarch
Published on 2010-04-30T18:36:32Z Indexed on 2010/04/30 18:47 UTC
Read the original article Hit count: 172

Filed under:
|

I have some models I'm working with in a new Django installation. Is it possible to change the fields without losing app data?

I tried changing the field and running python manage.py syncdb. There was no output from this command.

Renavigating to admin pages for editing the changed models caused TemplateSyntaxErrors as Django sought to display fields that didn't exist in the db.

I am using SQLite.

I am able to delete the db file, then re-run python manage.py syncdb, but that is kind of a pain. Is there a better way to do it?

© Stack Overflow or respective owner

Related posts about django

Related posts about python