我正在阅读Django教程:https : //docs.djangoproject.com/en/1.5/intro/tutorial01/
我有一个错误:
TypeError:__init__()出现了意外的关键字参数'Default'
当我打电话时会发生这种情况:
$python manage.py sql polls
或者
$python manage.py syncdb
我被困住了,无法弄清楚我在做什么错。
我刚刚开始了本教程的“激活模型”部分,并输入了已安装的应用程序
引用:[settings.py]
'Engine': 'django.db.backends.sqlite3'
'NAME': '/Users/msmith/Documents/djangoPractice/database.db'
$ python manage.py syncdb
$ python manage.py startapp polls
[polls.models.py]
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(Default=0)
[settings.py]-在列表底部添加了“民意调查”
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'polls',
)
$ python manage.py sql民意调查->发生错误
慕少森
相关分类