当我将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 / 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 docs.djangoproject/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/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错误
发布评论