Django 3.0.x Documentationto specify some default headers. For example, this will send a User-Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keywords arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 3085 页 | 2.95 MB | 1 年前3
Django 4.0.x Documentationto specify some default headers. For example, this will send a User-Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keyword arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page 3.11. Django’s cache framework content based on some difference in request headers – such as a cookie, or a language, or a user- agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 2248 页 | 7.90 MB | 1 年前3
Django 3.2.x Documentationto specify some default headers. For example, this will send a User-Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keyword arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user- agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 2199 页 | 7.89 MB | 1 年前3
Django 3.0.x Documentationto specify some default headers. For example, this will send a User-Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keywords arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 2002 页 | 6.73 MB | 1 年前3
Django 3.1.x Documentationto specify some default headers. For example, this will send a User-Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keyword arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 2053 页 | 6.92 MB | 1 年前3
Django 4.2.x Documentationdefault headers that will be sent with every request. For example, to set a User-Agent header: client = Client(headers={"user-agent": "curl/7.79.1"}) Arbitrary keyword arguments in **defaults set WSGI environ order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 3305 页 | 3.16 MB | 1 年前3
Django 4.1.x Documentationto specify some default headers. For example, this will send a User- Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keyword arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 3240 页 | 3.13 MB | 1 年前3
Django 4.0.x Documentationto specify some default headers. For example, this will send a User- Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keyword arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 3184 页 | 3.14 MB | 1 年前3
Django 3.2.x Documentationto specify some default headers. For example, this will send a User- Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keyword arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 3121 页 | 3.08 MB | 1 年前3
Django 3.1.x Documentationto specify some default headers. For example, this will send a User- Agent HTTP header in each request: >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0') The values from the extra keyword arguments passed order_by=author". This means every request to that URL will use the same cached version, regardless of user-agent differences such as cookies or language preferences. However, if this page produces different content content based on some difference in request headers – such as a cookie, or a language, or a user-agent – you’ll need to use the Vary header to tell caching mechanisms that the page output depends on those0 码力 | 3094 页 | 3.03 MB | 1 年前3
共 44 条
- 1
- 2
- 3
- 4
- 5













