Django 2.0 中 "django.core.xheaders" 的替代 Django 包
Alternative Django package for "django.core.xheaders" in Django 2.0
我正在将旧的 Django
项目迁移到 Django 2.0
。在其中一个视图文件中,我遇到了一个 import
语句:
from django.core.xheaders import populate_xheaders
我正在尝试找出这个包的替代方案——既不在 google 中也不在 Whosebug 中。
谁能帮我找到替代包?
django.core.xheaders
在 Django 1.6 中被移除。删除后将以下消息添加到文档中:
The django.contrib.flatpages
app used to set custom HTTP headers for
debugging purposes. This functionality was not documented and made caching
ineffective so it has been removed, along with its generic implementation,
previously available in django.core.xheaders
.
我怀疑您可以在您正在移植的应用程序中删除对此函数的调用。
如果您确实需要这些headers,您可以从the commit where it was removed复制功能。
有关最初创建此函数的原因的信息,请参阅 the ticket that tracked its addition。
我正在将旧的 Django
项目迁移到 Django 2.0
。在其中一个视图文件中,我遇到了一个 import
语句:
from django.core.xheaders import populate_xheaders
我正在尝试找出这个包的替代方案——既不在 google 中也不在 Whosebug 中。
谁能帮我找到替代包?
django.core.xheaders
在 Django 1.6 中被移除。删除后将以下消息添加到文档中:
The
django.contrib.flatpages
app used to set custom HTTP headers for debugging purposes. This functionality was not documented and made caching ineffective so it has been removed, along with its generic implementation, previously available indjango.core.xheaders
.
我怀疑您可以在您正在移植的应用程序中删除对此函数的调用。
如果您确实需要这些headers,您可以从the commit where it was removed复制功能。
有关最初创建此函数的原因的信息,请参阅 the ticket that tracked its addition。