summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authormartin.bohacek <bohacekm@gmail.com>2012-06-05 13:29:33 +0200
committermartin.bohacek <bohacekm@gmail.com>2012-06-05 13:29:33 +0200
commiteee791e9b216333ad0b4c6c441a88828bf9aee62 (patch)
tree3f01e97ea9b0ac28e9c9718b35ae92d163865b1c /docs/ref
parentfbb73894395b728ec96c661da6f87523718c5398 (diff)
parent840ffd80baad85c05670d6b642f654cffaa93cc3 (diff)
Merge branch 'master' of https://github.com/django/django
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/class-based-views.txt18
-rw-r--r--docs/ref/contrib/formtools/form-wizard.txt1
-rw-r--r--docs/ref/contrib/gis/geoquerysets.txt2
-rw-r--r--docs/ref/contrib/staticfiles.txt9
-rw-r--r--docs/ref/files/file.txt2
-rw-r--r--docs/ref/settings.txt5
-rw-r--r--docs/ref/templates/api.txt7
-rw-r--r--docs/ref/unicode.txt4
8 files changed, 38 insertions, 10 deletions
diff --git a/docs/ref/class-based-views.txt b/docs/ref/class-based-views.txt
index 174539d162..acd9db2d66 100644
--- a/docs/ref/class-based-views.txt
+++ b/docs/ref/class-based-views.txt
@@ -1171,7 +1171,15 @@ YearArchiveView
have objects available according to ``queryset``, represented as
``datetime.datetime`` objects, in ascending order.
- * ``year``: The given year, as a four-character string.
+ * ``year``: A ``datetime.date`` object representing the given year.
+
+ * ``next_year``: A ``datetime.date`` object representing the first day
+ of the next year. If the next year is in the future, this will be
+ ``None``.
+
+ * ``previous_year``: A ``datetime.date`` object representing the first
+ day of the previous year. Unlike ``next_year``, this will never be
+ ``None``.
**Notes**
@@ -1255,6 +1263,14 @@ WeekArchiveView
* ``week``: A ``datetime.date`` object representing the first day of
the given week.
+ * ``next_week``: A ``datetime.date`` object representing the first day
+ of the next week. If the next week is in the future, this will be
+ ``None``.
+
+ * ``previous_week``: A ``datetime.date`` object representing the first
+ day of the previous week. Unlike ``next_week``, this will never be
+ ``None``.
+
**Notes**
* Uses a default ``template_name_suffix`` of ``_archive_week``.
diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt
index a3d9673db9..7aafbe89f3 100644
--- a/docs/ref/contrib/formtools/form-wizard.txt
+++ b/docs/ref/contrib/formtools/form-wizard.txt
@@ -186,6 +186,7 @@ Here's a full example template:
.. code-block:: html+django
{% extends "base.html" %}
+ {% load i18n %}
{% block head %}
{{ wizard.form.media }}
diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt
index 7501fb3ec8..b9e3a7acd3 100644
--- a/docs/ref/contrib/gis/geoquerysets.txt
+++ b/docs/ref/contrib/gis/geoquerysets.txt
@@ -941,7 +941,7 @@ of the geometry field in each model converted to the requested output format.
``geohash``
~~~~~~~~~~~
-.. method:: GeoQuerySet.geohash(preceision=20, **kwargs)
+.. method:: GeoQuerySet.geohash(precision=20, **kwargs)
.. versionadded:: 1.2
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt
index 1dbd00b299..2bdf825316 100644
--- a/docs/ref/contrib/staticfiles.txt
+++ b/docs/ref/contrib/staticfiles.txt
@@ -348,6 +348,15 @@ CachedStaticFilesStorage
:setting:`CACHES` setting named ``'staticfiles'``. It falls back to using
the ``'default'`` cache backend.
+ .. method:: file_hash(name, content=None)
+
+ .. versionadded:: 1.5
+
+ The method that is used when creating the hashed name of a file.
+ Needs to return a hash for the given file name and content.
+ By default it calculates a MD5 hash from the content's chunks as
+ mentioned above.
+
.. _`far future Expires headers`: http://developer.yahoo.com/performance/rules.html#expires
.. _`@import`: http://www.w3.org/TR/CSS2/cascade.html#at-import
.. _`url()`: http://www.w3.org/TR/CSS2/syndata.html#uri
diff --git a/docs/ref/files/file.txt b/docs/ref/files/file.txt
index 013d113c84..10108d1f4f 100644
--- a/docs/ref/files/file.txt
+++ b/docs/ref/files/file.txt
@@ -96,7 +96,7 @@ The ``ContentFile`` Class
from django.core.files.base import ContentFile
- f1 = ContentFile("my string content")
+ f1 = ContentFile(b"my string content")
f2 = ContentFile(u"my unicode content encoded as UTF-8".encode('UTF-8'))
.. currentmodule:: django.core.files.images
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 398c90661b..a1b76f65e1 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -1605,7 +1605,8 @@ method.
This takes some explanation. By default, ``is_secure()`` is able to determine
whether a request is secure by looking at whether the requested URL uses
-"https://".
+"https://". This is important for Django's CSRF protection, and may be used
+by your own code or third-party apps.
If your Django app is behind a proxy, though, the proxy may be "swallowing" the
fact that a request is HTTPS, using a non-HTTPS connection between the proxy
@@ -1635,7 +1636,7 @@ available in ``request.META``.)
.. warning::
- **You will probably open security holes in your site if you set this without knowing what you're doing. Seriously.**
+ **You will probably open security holes in your site if you set this without knowing what you're doing. And if you fail to set it when you should. Seriously.**
Make sure ALL of the following are true before setting this (assuming the
values from the example above):
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index aece572e07..e945e0d4ca 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -790,9 +790,10 @@ templating functions, call :func:`django.conf.settings.configure()` with any
settings you wish to specify. You might want to consider setting at least
:setting:`TEMPLATE_DIRS` (if you're going to use template loaders),
:setting:`DEFAULT_CHARSET` (although the default of ``utf-8`` is probably fine)
-and :setting:`TEMPLATE_DEBUG`. All available settings are described in the
-:doc:`settings documentation </ref/settings>`, and any setting starting with
-``TEMPLATE_`` is of obvious interest.
+and :setting:`TEMPLATE_DEBUG`. If you plan to use the :ttag:`url` template tag,
+you will also need to set the :setting:`ROOT_URLCONF` setting. All available
+settings are described in the :doc:`settings documentation </ref/settings>`,
+and any setting starting with ``TEMPLATE_`` is of obvious interest.
.. _topic-template-alternate-language:
diff --git a/docs/ref/unicode.txt b/docs/ref/unicode.txt
index 1286dcfdd0..46ce4138a4 100644
--- a/docs/ref/unicode.txt
+++ b/docs/ref/unicode.txt
@@ -269,7 +269,7 @@ You can pass either Unicode strings or UTF-8 bytestrings as arguments to
querysets are identical::
qs = People.objects.filter(name__contains=u'Å')
- qs = People.objects.filter(name__contains='\xc3\x85') # UTF-8 encoding of Å
+ qs = People.objects.filter(name__contains=b'\xc3\x85') # UTF-8 encoding of Å
Templates
=========
@@ -277,7 +277,7 @@ Templates
You can use either Unicode or bytestrings when creating templates manually::
from django.template import Template
- t1 = Template('This is a bytestring template.')
+ t1 = Template(b'This is a bytestring template.')
t2 = Template(u'This is a Unicode template.')
But the common case is to read templates from the filesystem, and this creates