使用Django 1.5运行manage.py syncdb错误 [英] Run manage.py syncdb error with Django 1.5

查看:72
本文介绍了使用Django 1.5运行manage.py syncdb错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将Django从1.4升级到1.5并运行manage.py syncdb时,出现以下错误

When I upgrade django from 1.4 to 1.5, and run manage.py syncdb, there is a error as following


$ python manage .py syncdb

$ python manage.py syncdb

/usr/local/lib/python2.7/dist-packages/django/conf/ init .py:219: DeprecationWarning:您没有在'mail_admins'日志记录处理程序上定义过滤器:添加了隐式的debug-false-only过滤器。参见 http://docs.djangoproject .com / en / dev / releases / 1.4 /#request-exceptions-are-now-always-logged
DeprecationWarning)

/usr/local/lib/python2.7/dist-packages/django/conf/init.py:219: DeprecationWarning: You have no filters defined on the 'mail_admins' logging handler: adding implicit debug-false-only filter. See http://docs.djangoproject.com/en/dev/releases/1.4/#request-exceptions-are-now-always-logged DeprecationWarning)

TypeError: init ()有一个意外的关键字参数'verify_exists'

TypeError: init() got an unexpected keyword argument 'verify_exists'

非常感谢!

推荐答案

verify_exists 关键字参数。 djangoproject.com/en/dev/ref/models/fields/#urlfield rel = nofollow>模型 URLField 已被删除(自1.3开始贬值。 1)。您可以在 1.5的django折旧说明中阅读更多内容

The verify_exists keyword argument for a model URLField has been removed (depreciated since 1.3.1). You can read more in the django depreciation notes for 1.5:


django.db.models.fields.URLField.verify_exists将被删除。由于棘手的安全性和性能问题,此功能在1.3.1中已弃用,并且将遵循略有加速的弃用时间框架。

django.db.models.fields.URLField.verify_exists will be removed. The feature was deprecated in 1.3.1 due to intractable security and performance issues and will follow a slightly accelerated deprecation timeframe.

简单的修复方法是在引发错误的相应 models.py 中找到有问题的 models.URLField ,并删除 verify_exists = True ,即:

The simple fix is to find the offending models.URLField in the appropriate models.py that is throwing the error and remove the verify_exists=True, i.e:

# Before
some_site = models.URLField(verify_exists=True)

# After
some_site = models.URLField()

这篇关于使用Django 1.5运行manage.py syncdb错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆