Please write to django-users (as I see you already did), this mailing list 
is for the development of Django itself.

On Thursday, November 19, 2015 at 12:26:34 PM UTC-5, Cision Lee wrote:
>
> *I meet some errors when I migrate database, and the error code is 
> following:*
>
> Operations to perform:
>   Synchronize unmigrated apps: staticfiles, messages
>   Apply all migrations: admin, contenttypes, api, auth, sessions
> Synchronizing apps without migrations:
>   Creating tables...
>     Running deferred SQL...
>   Installing custom SQL...
> Running migrations:
>   Rendering model states... DONE
>   Applying api.0004_auto_20151119_1545...Traceback (most recent call last
> ):
>   File "manage.py", line 10, in <module>
>     execute_from_command_line(sys.argv)
>   File 
> "/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
> line 354, in execute_from_command_line
>     utility.execute()
>   File 
> "/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
> line 346, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Library/Python/2.7/site-packages/django/core/management/base.py", 
> line 394, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File "/Library/Python/2.7/site-packages/django/core/management/base.py", 
> line 445, in execute
>     output = self.handle(*args, **options)
>   File 
> "/Library/Python/2.7/site-packages/django/core/management/commands/migrate.py"
> , line 222, in handle
>     executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
>   File 
> "/Library/Python/2.7/site-packages/django/db/migrations/executor.py", 
> line 110, in migrate
>     self.apply_migration(states[migration], migration, fake=fake, 
> fake_initial=fake_initial)
>   File 
> "/Library/Python/2.7/site-packages/django/db/migrations/executor.py", 
> line 148, in apply_migration
>     state = migration.apply(state, schema_editor)
>   File 
> "/Library/Python/2.7/site-packages/django/db/migrations/migration.py", 
> line 115, in apply
>     operation.database_forwards(self.app_label, schema_editor, old_state, 
> project_state)
>   File 
> "/Library/Python/2.7/site-packages/django/db/migrations/operations/fields.py"
> , line 62, in database_forwards
>     field,
>   File 
> "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/schema.py", 
> line 179, in add_field
>     self._remake_table(model, create_fields=[field])
>   File 
> "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/schema.py", 
> line 77, in _remake_table
>     self.effective_default(field)
>   File 
> "/Library/Python/2.7/site-packages/django/db/backends/base/schema.py", 
> line 211, in effective_default
>     default = field.get_db_prep_save(default, self.connection)
>   File 
> "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", 
> line 710, in get_db_prep_save
>     prepared=False)
>   File 
> "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", 
> line 1322, in get_db_prep_value
>     value = self.get_prep_value(value)
>   File 
> "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", 
> line 1317, in get_prep_value
>     return self.to_python(value)
>   File 
> "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", 
> line 1274, in to_python
>     parsed = parse_date(value)
>   File "/Library/Python/2.7/site-packages/django/utils/dateparse.py", 
> line 60, in parse_date
>     match = date_re.match(value)
> TypeError: expected string or buffer
> *and the code of models.py is,*
>
>  
>
> from django.core.exceptions import ValidationError
> from django.utils.dateformat import format
> from django.contrib.auth.models import AbstractUser
> from datetime import date
> import datetime
> from django.conf import settings
> from django.db.models import Sum
> from django.utils import timezone
> from django.utils.dateformat import format
> # Create your models here.
> #Users, Contacts, Events
>
>
>
> class User(models.Model):
>     phonenum = models.CharField(max_length=20)
>     username = models.CharField(max_length=20)
>
>     def get_usr_info(self):
>         data = {}  # dictionary
>         data['phonenum'] = self.phonenum
>         data
>         data['name'] = self.username
>
>
>        
>
>
>         return data
>
>
>
>
>
>
>
>
> class Co
>
> ...

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/da017afa-51f6-404e-b27c-c10557cbf258%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to