Django“模块”对象没有属性“StringProperty”;
我才刚刚开始......我正在尝试使用 Django 模型,但我得到了:
AttributeError: 'module' object has no attribute 'StringProperty'
您能告诉我问题出在哪里吗?
from django.db import models
# Create your models here.
class Test(models.Model):
text = models.StringProperty()
date = models.DateTimeProperty()
谢谢你!
I'm just starting... I'm trying to use Django models but I'm getting the:
AttributeError: 'module' object has no attribute 'StringProperty'
Can you please tell where can be the issue?
from django.db import models
# Create your models here.
class Test(models.Model):
text = models.StringProperty()
date = models.DateTimeProperty()
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题是您有一些虚假的模型字段类型。以下是 django 的正确字段(在 django 模型字段参考文档)
Your problem is you've got some bogus model field types. Here are the correct ones for django (read about them and other available field types in the django model field reference docs)