django - Adding Model Attribute with MySQL later in project -


i have working django project , want add new model attribute. how do this?

currently have done

class stream(models.model):     workingattributes = models.charfield(max_length=100)     step = models.charfield(max_length=1) 

when run 'python manage.py runserver' receive

databaseerror: (1054, "unknown column 'livestream_stream.step' in 'field list'") 

i have gone mamp , accessed database , added new column 'step', receive same error. have recommendations on how add new attributes? thanks

you need use south (or similar) schemamigration. read documents see how it. it's quite easy, , helpful later in project (when have lots of data in database). other option (other using migration tool) drop database , create again, lose of data.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -