django 'module' object has no attribute 'StringProperty'
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 p开发者_JAVA技巧lease 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!
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)
from django.db import models
# Create your models here.
class Test(models.Model):
text = models.CharField(max_length=255)
date = models.DateTimeField()
精彩评论