Yes, make the column wider. The error message is quite clear: your 200 characters are too big to fit in a varchar(4).
First, update your model fields max_length
attribute from 4 to a number that you expect will be long enough to contain the data you're feeding it.
Next up you have to update the database column itself as django will not automatically update existing columns.
Here are a few options:
1:
Drop the database and run syncdb again. Warning: you will lose all your data.
2: Manually update the column via SQL:
Type in python manage.py dbshell
to get into your database shell and type in
ALTER TABLE my_table ALTER COLUMN my_column TYPE VARCHAR(200)
3: Learn and use a database migration tool like django south which will help keep your database updated with your model code.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…