尝试从django的1.7.4升级到1.8; 但是,当我运行服务器时,我现在得到了
There is no South database module 'south.db.mysql' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS.
错误消息,它不起作用.我的INSTALLED_APPS中没有'South'.并且不记得在这个项目上曾经使用过南方.我的所有模型实际上是手动管理的.
我该如何解决?
谢谢
[编辑]你会看到,我有很多"升级"修复,但仍然不明白为什么它在'南'失败,我不使用它.
INSTALLED_APPS = (
'django_admin_bootstrapped',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'bootstrap3',
'towel',
'email_registration',
'visits',
'django_markdown',
'debug_toolbar',
'LessonApp',
'bootstrap_pagination',
'django_tables2',
'util',
'memcache_admin',
'twitter_feed',
'cec_cms',
'ckeditor',
'filebrowser',
'user_profile',
'eztexting',
'secure_file',
'partboard',
)
Run Code Online (Sandbox Code Playgroud)
追溯:
/usr/local/lib/python2.7/dist-packages/django_tables2/tables.py:171: RemovedInDjango19Warning: SortedDict is deprecated and will be removed in Django 1.9.
attrs["base_columns"] = SortedDict(parent_columns)
/usr/local/lib/python2.7/dist-packages/django_tables2/tables.py:193: RemovedInDjango19Warning: …Run Code Online (Sandbox Code Playgroud) 不确定这是否是Django中的错误,或者它不支持我正在尝试做的事情(或者我是如何做的).
我的模型的片段:
class UserProfile(models.Model):
user = models.OneToOneField(User, primary_key=True, related_name='profile'
login_hash = models.CharField(max_length=36, blank=True, null=True, default=uuid.uuid4())
...
Run Code Online (Sandbox Code Playgroud)
如您所见,我已将默认值设置为login_hash调用uuid.uuid4()
工作正常...但是,多次调用UserProfile(快速创建新用户,甚至看似几分钟,但我不是正式时间)将导致login_hash多个用户相同.
似乎django(我在1.7.4)正在缓存uuid4()一段时间的结果.对我正在尝试做的事情不利.
解决方案:我正在使用.我只是在数据库上设置了一个'on insert'触发器,这样当我插入一条新记录时,数据库就会生成UUID,但仅限于插入/新记录.
有没有办法在django中做到这一点,以便我可以保持数据库不可知?