使用Django 1.5运行manage.py syncdb错误

编程入门 行业动态 更新时间:2024-10-26 18:26:18
本文介绍了使用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 / 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错误

本文发布于:2023-10-22 22:19:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1518890.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   Django   manage   syncdb   py

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!