我在Windows Vista上使用Python 2.7在Django 1.5中编程。我正在尝试创建用户配置文件。但是,什么时候
我访问localhost:8000 / admin / home / userprofile,我收到1146, "Table 'demo.home_userprofile' doesn't exist
错误。
现在我进入settings.py
:
AUTH_PROFILE_MODULE = 'home.userProfile'
并在models.py
中,我有定义值
from django.db import models
from django.contrib.auth.models import User
class userProfile(models.Model):
user = models.OneToOneField(User)
photo = models.ImageField(upload_to = url)
telefono = models.CharField(max_length = 30)
def url(self, filename):
ruta = "MultimediaData/Users/$s/%s"%(self.user.username, filename)
return ruta
def __unicode__(self):
return self.user.username
和admin.py
:
from django.contrib import admin
from demo.apps.home.models import userProfile
admin.site.register(userProfile)
我已经考虑了一段时间了。什么似乎是错的?