关于报错:
1.在页面添加好新的用户后登录报错
解决方法:
新建一个app,名叫app
D:\myfiles\study\python\django\datas>python manage.py startapp app
然后在app.models.py中添加如下代码:
from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class AccessRecord(models.Model): date = models.DateField() user_count = models.IntegerField() view_count = models.IntegerField() class Meta: verbose_name = u"访问日志" verbose_name_plural = verbose_name def __str__(self): return "%s Access Record" % self.date.strftime('%Y-%m-%d')
完毕!