I have a working project and I would like to add one new field to one of the models.
I have added the new field and ran the makemigrations command and then I got ValueError: too many values to unpack
This is the model:
class Line(models.Model):
name = models.CharField(max_length=250, null=False, blank=False, unique=True)
label_name = models.CharField(max_length=250, null=True, blank=True, unique=True)
and I wanted to add this field:
link = models.CharField(max_length=200,null=True,blank=True, unique=True)
Then I ran makemigrations command, and got this exception exception:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2017.3.3\helpers\pycharm\django_manage.py", line 52, in <module>
run_command()
File "C:\Program Files\JetBrains\PyCharm 2017.3.3\helpers\pycharm\django_manage.py", line 46, in run_command
run_module(manage_file, None, '__main__', True)
File "C:\Python27\lib\runpy.py", line 176, in run_module
fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "F:\cellular_resolution_map_of_larval_zebrafish\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 350, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 399, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\makemigrations.py", line 105, in handle
loader.project_state(),
File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 338, in project_state
return self.graph.make_state(nodes=nodes, at_end=at_end, real_apps=list(self.unmigrated_apps))
File "C:\Python27\lib\site-packages\django\db\migrations\graph.py", line 280, in make_state
project_state = self.nodes[node].mutate_state(project_state, preserve=False)
File "C:\Python27\lib\site-packages\django\db\migrations\migration.py", line 88, in mutate_state
operation.state_forwards(self.app_label, new_state)
File "C:\Python27\lib\site-packages\django\db\migrations\operations\fields.py", line 51, in state_forwards
state.reload_model(app_label, self.model_name_lower)
File "C:\Python27\lib\site-packages\django\db\migrations\state.py", line 148, in reload_model
self.apps.render_multiple(states_to_be_rendered)
File "C:\Python27\lib\site-packages\django\db\migrations\state.py", line 296, in render_multiple
model.render(self)
File "C:\Python27\lib\site-packages\django\db\migrations\state.py", line 585, in render
body,
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 158, in __new__
new_class.add_to_class(obj_name, obj)
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 299, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Python27\lib\site-packages\django\db\models\fields\related.py", line 702, in contribute_to_class
super(ForeignObject, self).contribute_to_class(cls, name, virtual_only=virtual_only)
File "C:\Python27\lib\site-packages\django\db\models\fields\related.py", line 308, in contribute_to_class
lazy_related_operation(resolve_related_class, cls, self.remote_field.model, field=self)
File "C:\Python27\lib\site-packages\django\db\models\fields\related.py", line 85, in lazy_related_operation
return apps.lazy_model_operation(partial(function, **kwargs), *model_keys)
File "C:\Python27\lib\site-packages\django\db\models\fields\related.py", line 83, in <genexpr>
model_keys = (make_model_tuple(m) for m in models)
File "C:\Python27\lib\site-packages\django\db\models\utils.py", line 13, in make_model_tuple
app_label, model_name = model.split(".")
ValueError: too many values to unpack
How can I solve it?
Thank you very much.
Related
python manage.py loaddata --settings definme.settings.dev django-dump.json
wagtail.models.i18n.Locale.DoesNotExist: Problem installing fixture Locale matching query does not exist.
Unfortunately that isn't enough information to help you. The error message is saying you are missing some locale information. For anyone here to help you we need to know how you created your django-dump.json file and the status of the database you are importing into.
Traceback (most recent call last):
File "/Users/noro/Documents/Ongrid/definme/definme/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 102, in handle
self.loaddata(fixture_labels)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 163, in loaddata
self.load_label(fixture_label)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 253, in load_label
if self.save_obj(obj):
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 209, in save_obj
obj.save(using=self.using)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/serializers/base.py", line 281, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/base.py", line 841, in save_base
pre_save.send(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
return [
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in
(receiver, receiver(signal=self, sender=sender, **named))
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 368, in set_locale_on_new_instance
instance.locale = Locale.get_default()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 61, in get_default
return cls.objects.get_for_language(settings.LANGUAGE_CODE)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 34, in get_for_language
return self.get(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/query.py", line 496, in get
raise self.model.DoesNotExist(
wagtail.models.i18n.Locale.DoesNotExist: Problem installing fixture '/Users/noro/Documents/Ongrid/definme/django-dump.json': Locale matching query does not exist.
(venv) noro#Norayrs-MacBook-Air definme % python definme/manage.py loaddata django-dump.json
Traceback (most recent call last):
File "/Users/noro/Documents/Ongrid/definme/definme/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 102, in handle
self.loaddata(fixture_labels)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 163, in loaddata
self.load_label(fixture_label)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 253, in load_label
if self.save_obj(obj):
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 209, in save_obj
obj.save(using=self.using)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/serializers/base.py", line 281, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/base.py", line 841, in save_base
pre_save.send(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
return [
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in
(receiver, receiver(signal=self, sender=sender, **named))
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 368, in set_locale_on_new_instance
instance.locale = Locale.get_default()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 61, in get_default
return cls.objects.get_for_language(settings.LANGUAGE_CODE)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 34, in get_for_language
return self.get(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/query.py", line 496, in get
raise self.model.DoesNotExist(
wagtail.models.i18n.Locale.DoesNotExist: Problem installing fixture '/Users/noro/Documents/Ongrid/definme/django-dump.json': Locale matching query does not exist.
I'm trying to migrate my datas, but django returns me TypeError: expected string or bytes-like object error, although I just tried using datetime once, then deleted it, but still it returns an error. Here are my codes:
models.py
class Applicant(models.Model):
name = models.CharField(max_length=20)
surname = models.CharField(max_length=30)
phone = models.CharField(max_length=15)
email = models.EmailField(max_length=40)
motivation_letter = models.TextField(max_length=200)
is_accepted = models.BooleanField(default=False)
photo = models.FileField(upload_to='static/applicant_photos')
def __str__(self):
return self.name
an error:
Operations to perform:
Apply all migrations: admin, auth, ccapp, contenttypes, sessions
Running migrations:
Applying ccapp.0003_applicant_birth_date...Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/commands/migrate.py", line 234, in handle
fake_initial=fake_initial,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/executor.py", line 245, in apply_migration
state = migration.apply(state, schema_editor)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/migration.py", line 124, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/operations/fields.py", line 112, in database_forwards
field,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/sqlite3/schema.py", line 327, in add_field
self._remake_table(model, create_field=field)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/sqlite3/schema.py", line 188, in _remake_table
self.effective_default(create_field)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/backends/base/schema.py", line 233, in effective_default
return field.get_db_prep_save(self._effective_default(field), self.connection)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/__init__.py", line 789, in get_db_prep_save
return self.get_db_prep_value(value, connection=connection, prepared=False)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/__init__.py", line 1431, in get_db_prep_value
value = self.get_prep_value(value)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/__init__.py", line 1410, in get_prep_value
value = super().get_prep_value(value)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/__init__.py", line 1270, in get_prep_value
return self.to_python(value)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/__init__.py", line 1371, in to_python
parsed = parse_datetime(value)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/utils/dateparse.py", line 106, in parse_datetime
match = datetime_re.match(value)
TypeError: expected string or bytes-like object
Traceback (most recent call last):
File "manage.py", line 28, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 231, in execute
self.validate()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name, True)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/cartridge/shop/models.py", line 411, in <module>
class Order(models.Model):
File "/usr/local/lib/python2.7/dist-packages/cartridge/shop/models.py", line 422, in Order
billing_detail_country = ForeignKey(Category, verbose_name = _("State/Region"), related_name='order', limit_choices_to={ "parent":Category.objects.get(slug='regions') }, blank=True, null=True)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 344, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: no such table: shop_category
Hello.
python manage.py runserver 127.0.0.1:80 not running on server.
In MySQL table shop_category present. In settings.py name DB, login and password configured.
syncdb not solved my problem.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
I am trying to apply tutorial http://docs.django-cms.org/en/2.1.3/getting_started/tutorial.html.
But I didn't succeed to perform the initial database setup
Why do I get this error when I run "python manage.py syncdb --all" ?
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 381, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 230, in execute
self.validate()
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "C:\Python27\lib\site-packages\django\core\management\validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 158, in get_app_errors
self._populate()
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 64, in _populate
self.load_app(app_name, True)
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
__import__(name)
File "C:\Python27\lib\site-packages\django_cms-2.2-py2.7.egg\cms\plugins\link\models.py", line 5, in <module>
class Link(CMSPlugin):
File "C:\Python27\lib\site-packages\django_cms-2.2-py2.7.egg\cms\plugins\link\models.py", line 11, in Link
url = models.URLField(_("link"), verify_exists=False, blank=True, null=True)
File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", line 1265, in __init__
CharField.__init__(self, verbose_name, name, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py", line 614, in __init__
super(CharField, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'verify_exists'
The verify_exists parameter for UrlField was deprecated in the 1.3.1 security release and removed in the current Git master (1.5dev). https://docs.djangoproject.com/en/1.4/internals/deprecation/. This makes this version of django-cms incompatible with the current master. I would recommend using a stable Django release such as the latest 1.4 rather than master.
Why do I get this error when I run manage.py validate?:
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "C:\python26\lib\site-packages\django\core\management\__init__.py", line
438, in execute_manager
utility.execute()
File "C:\python26\lib\site-packages\django\core\management\__init__.py", line
379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\python26\lib\site-packages\django\core\management\base.py", line 191,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\python26\lib\site-packages\django\core\management\base.py", line 218,
in execute
output = self.handle(*args, **options)
File "C:\python26\lib\site-packages\django\core\management\base.py", line 347,
in handle
return self.handle_noargs(**options)
File "C:\python26\lib\site-packages\django\core\management\commands\validate.p
y", line 9, in handle_noargs
self.validate(display_num_errors=True)
File "C:\python26\lib\site-packages\django\core\management\base.py", line 245,
in validate
num_errors = get_validation_errors(s, app)
File "C:\python26\lib\site-packages\django\core\management\validation.py", lin
e 28, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\python26\lib\site-packages\django\db\models\loading.py", line 146, in
get_app_errors
self._populate()
File "C:\python26\lib\site-packages\django\db\models\loading.py", line 61, in
_populate
self.load_app(app_name, True)
File "C:\python26\lib\site-packages\django\db\models\loading.py", line 78, in
load_app
models = import_module('.models', app_name)
File "C:\python26\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\projects\mysite\..\mysite\books\models.py", line 5, in <module>
class Publisher(models.Model):
File "C:\projects\mysite\..\mysite\books\models.py", line 6, in Publisher
name = models.CharField(maxlength=30)
File "C:\python26\lib\site-packages\django\db\models\fields\__init__.py", line
542, in __init__
super(CharField, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'maxlength'
The problem is that you are using a newer version of Django now. Since 1.0 (or actually, somewhere in 0.97) Django switched to max_length instead of maxlength. So either upgrade your code or install Django 0.96 for it to work again.
It's difficult to be 100% sure, because you haven't included the code in mysite/books/models.py, but it would appear that the 'max_length' keyword argument to a CharField in the Publisher class has been misspelled 'maxlength'.
See here for the correct values:
http://docs.djangoproject.com/en/dev/ref/models/fields/#charfield