diff --git a/django/utils/html.py b/django/utils/html.py
index c985538041..951b3f2a59 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -28,7 +28,9 @@ trailing_empty_content_re = re.compile(r'(?:
(?: |\s|
)*?
\s*)+\
del x # Temporary variable
def escape(html):
- """Returns the given HTML with ampersands, quotes and carets encoded."""
+ """
+ Returns the given HTML with ampersands, quotes and angle brackets encoded.
+ """
return mark_safe(force_unicode(html).replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"').replace("'", '''))
escape = allow_lazy(escape, unicode)
diff --git a/docs/_static/djangodocs.css b/docs/_static/djangodocs.css
index fdaccf70ba..a41be6d1b0 100644
--- a/docs/_static/djangodocs.css
+++ b/docs/_static/djangodocs.css
@@ -103,9 +103,9 @@ dt .literal, table .literal { background:none; }
.note, .admonition { padding:.8em 1em .8em; margin: 1em 0; border:1px solid #94da3a; }
.admonition-title { font-weight:bold; margin-top:0 !important; margin-bottom:0 !important;}
.admonition .last { margin-bottom:0 !important; }
-.note, .admonition { padding-left:65px; background:url(docicons-note.gif) .8em .8em no-repeat;}
-div.admonition-philosophy { padding-left:65px; background:url(docicons-philosophy.gif) .8em .8em no-repeat;}
-div.admonition-behind-the-scenes { padding-left:65px; background:url(docicons-behindscenes.gif) .8em .8em no-repeat;}
+.note, .admonition { padding-left:65px; background:url(docicons-note.png) .8em .8em no-repeat;}
+div.admonition-philosophy { padding-left:65px; background:url(docicons-philosophy.png) .8em .8em no-repeat;}
+div.admonition-behind-the-scenes { padding-left:65px; background:url(docicons-behindscenes.png) .8em .8em no-repeat;}
/*** versoinadded/changes ***/
div.versionadded, div.versionchanged { }
diff --git a/docs/_static/docicons-behindscenes.gif b/docs/_static/docicons-behindscenes.gif
deleted file mode 100644
index 921bc45c33..0000000000
Binary files a/docs/_static/docicons-behindscenes.gif and /dev/null differ
diff --git a/docs/_static/docicons-behindscenes.png b/docs/_static/docicons-behindscenes.png
new file mode 100644
index 0000000000..dc901bc867
Binary files /dev/null and b/docs/_static/docicons-behindscenes.png differ
diff --git a/docs/_static/docicons-note.gif b/docs/_static/docicons-note.gif
deleted file mode 100644
index c0d599e90a..0000000000
Binary files a/docs/_static/docicons-note.gif and /dev/null differ
diff --git a/docs/_static/docicons-note.png b/docs/_static/docicons-note.png
new file mode 100644
index 0000000000..357545fb32
Binary files /dev/null and b/docs/_static/docicons-note.png differ
diff --git a/docs/_static/docicons-philosophy.gif b/docs/_static/docicons-philosophy.gif
deleted file mode 100644
index 432d93ba79..0000000000
Binary files a/docs/_static/docicons-philosophy.gif and /dev/null differ
diff --git a/docs/_static/docicons-philosophy.png b/docs/_static/docicons-philosophy.png
new file mode 100644
index 0000000000..09f16c785b
Binary files /dev/null and b/docs/_static/docicons-philosophy.png differ
diff --git a/docs/howto/custom-file-storage.txt b/docs/howto/custom-file-storage.txt
index 8620b37603..cfb3226289 100644
--- a/docs/howto/custom-file-storage.txt
+++ b/docs/howto/custom-file-storage.txt
@@ -63,7 +63,11 @@ backend storage system.
Called by ``Storage.save()``. The ``name`` will already have gone through
``get_valid_name()`` and ``get_available_name()``, and the ``content`` will be a
-``File`` object itself. No return value is expected.
+``File`` object itself.
+
+Should return the actual name of name of the file saved (usually the ``name``
+passed in, but if the storage needs to change the file name return the new name
+instead).
``get_valid_name(name)``
------------------------
diff --git a/docs/howto/deployment/modpython.txt b/docs/howto/deployment/modpython.txt
index 3c3af82ec4..331515bdd8 100644
--- a/docs/howto/deployment/modpython.txt
+++ b/docs/howto/deployment/modpython.txt
@@ -17,14 +17,22 @@ performance gains over other server arrangements.
Django requires Apache 2.x and mod_python 3.x, and you should use Apache's
`prefork MPM`_, as opposed to the `worker MPM`_.
-You may also be interested in :ref:`How to use Django with FastCGI, SCGI, or
-AJP `.
+.. seealso::
+
+ * Apache is a big, complex animal, and this document only scratches the
+ surface of what Apache can do. If you need more advanced information about
+ Apache, there's no better source than `Apache's own official
+ documentation`_
+
+ * You may also be interested in :ref:`How to use Django with FastCGI, SCGI,
+ or AJP `.
.. _Apache: http://httpd.apache.org/
.. _mod_python: http://www.modpython.org/
.. _mod_perl: http://perl.apache.org/
.. _prefork MPM: http://httpd.apache.org/docs/2.2/mod/prefork.html
.. _worker MPM: http://httpd.apache.org/docs/2.2/mod/worker.html
+.. _apache's own official documentation: http://httpd.apache.org/docs/
Basic configuration
===================
@@ -52,15 +60,15 @@ Django mod_python handler." It passes the value of :ref:`DJANGO_SETTINGS_MODULE
.. versionadded:: 1.0
The ``PythonOption django.root ...`` is new in this version.
-Because mod_python does not know we are
-serving this site from underneath the ``/mysite/`` prefix, this value needs to
-be passed through to the mod_python handler in Django, via the ``PythonOption
-django.root ...`` line. The value set on that line (the last item) should
-match the string given in the ```` directive. The effect of this
-is that Django will automatically strip the ``/mysite`` string from the front
-of any URLs before matching them against your URLconf patterns. If you later
-move your site to live under ``/mysite2``, you will not have to change anything
-except the ``django.root`` option in the config file.
+Because mod_python does not know we are serving this site from underneath the
+``/mysite/`` prefix, this value needs to be passed through to the mod_python
+handler in Django, via the ``PythonOption django.root ...`` line. The value set
+on that line (the last item) should match the string given in the ```` directive. The effect of this is that Django will automatically strip the
+``/mysite`` string from the front of any URLs before matching them against your
+URLconf patterns. If you later move your site to live under ``/mysite2``, you
+will not have to change anything except the ``django.root`` option in the config
+file.
When using ``django.root`` you should make sure that what's left, after the
prefix has been removed, begins with a slash. Your URLconf patterns that are
@@ -97,6 +105,10 @@ setting the Python path for interactive usage. Whenever you try to import
something, Python will run through all the directories in ``sys.path`` in turn,
from first to last, and try to import from each directory until one succeeds.
+Make sure that your Python source files' permissions are set such that the
+Apache user (usually named ``apache`` or ``httpd`` on most systems) will have
+read access to the files.
+
An example might make this clearer. Suppose you have some applications under
``/usr/local/django-apps/`` (for example, ``/usr/local/django-apps/weblog/`` and
so forth), your settings file is at ``/var/www/mysite/settings.py`` and you have
diff --git a/docs/howto/initial-data.txt b/docs/howto/initial-data.txt
index b005c01b06..d36329daa4 100644
--- a/docs/howto/initial-data.txt
+++ b/docs/howto/initial-data.txt
@@ -47,7 +47,7 @@ look like in JSON:
"first_name": "Paul",
"last_name": "McCartney"
}
- },
+ }
]
And here's that same fixture as YAML:
diff --git a/docs/howto/static-files.txt b/docs/howto/static-files.txt
index a5e069f6f0..43062bebb6 100644
--- a/docs/howto/static-files.txt
+++ b/docs/howto/static-files.txt
@@ -10,9 +10,9 @@ How to serve static files
Django itself doesn't serve static (media) files, such as images, style sheets,
or video. It leaves that job to whichever Web server you choose.
-The reasoning here is that standard Web servers, such as Apache_, lighttpd_ and Cherokee_,
-are much more fine-tuned at serving static files than a Web application
-framework.
+The reasoning here is that standard Web servers, such as Apache_, lighttpd_ and
+Cherokee_, are much more fine-tuned at serving static files than a Web
+application framework.
With that said, Django does support static files **during development**. You can
use the :func:`django.views.static.serve` view to serve media files.
@@ -21,6 +21,11 @@ use the :func:`django.views.static.serve` view to serve media files.
.. _lighttpd: http://www.lighttpd.net/
.. _Cherokee: http://www.cherokee-project.com/
+.. seealso::
+
+ If you just need to serve the admin media from a nonstandard location, see
+ the :djadminopt:`--adminmedia` parameter to :djadmin:`runserver`.
+
The big, fat disclaimer
=======================
diff --git a/docs/intro/tutorial01.txt b/docs/intro/tutorial01.txt
index 8feb22141e..a97359667f 100644
--- a/docs/intro/tutorial01.txt
+++ b/docs/intro/tutorial01.txt
@@ -134,18 +134,27 @@ It worked!
.. admonition:: Changing the port
By default, the :djadmin:`runserver` command starts the development server
- on port 8000. If you want to change the server's port, pass it as a
- command-line argument. For instance, this command starts the server on port
- 8080:
+ on the internal IP at port 8000.
+
+ If you want to change the server's port, pass
+ it as a command-line argument. For instance, this command starts the server
+ on port 8080:
.. code-block:: bash
python manage.py runserver 8080
+
+ If you want to change the server's IP, pass it along with the port. So to
+ listen on all public IPs (useful if you want to show off your work on other
+ computers), use:
+
+ .. code-block:: bash
+
+ python manage.py runserver 0.0.0.0:8000
Full docs for the development server can be found in the
:djadmin:`runserver` reference.
-
Database setup
--------------
diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt
index df48a0286a..ca0b985508 100644
--- a/docs/intro/tutorial03.txt
+++ b/docs/intro/tutorial03.txt
@@ -302,6 +302,13 @@ for a given poll. Here's the view::
The new concept here: The view raises the :exc:`~django.http.Http404` exception
if a poll with the requested ID doesn't exist.
+We'll discuss what you could put in that ``polls/detail.html`` template a bit
+later, but if you'd like to quickly get the above example working, just::
+
+ {{ poll }}
+
+will get you started for now.
+
A shortcut: get_object_or_404()
-------------------------------
@@ -357,6 +364,10 @@ in ``django/conf/urls/defaults.py``, ``handler404`` is set to
Three more things to note about 404 views:
+ * If :setting:`DEBUG` is set to ``True`` (in your settings module) then your
+ 404 view will never be used (and thus the ``404.html`` template will never
+ be rendered) because the traceback will be displayed instead.
+
* The 404 view is also called if Django doesn't find a match after checking
every regular expression in the URLconf.
@@ -365,8 +376,9 @@ Three more things to note about 404 views:
template in the root of your template directory. The default 404 view will
use that template for all 404 errors.
- * If :setting:`DEBUG` is set to ``True`` (in your settings module) then your
- 404 view will never be used, and the traceback will be displayed instead.
+ * If :setting:`DEBUG` is set to ``False`` (in your settings module) and if
+ you didn't create a ``404.html`` file, an ``Http500`` is raised instead.
+ So remember to create a ``404.html``.
Write a 500 (server error) view
===============================
diff --git a/docs/intro/tutorial04.txt b/docs/intro/tutorial04.txt
index 5c2e1e8ec1..07aa477d67 100644
--- a/docs/intro/tutorial04.txt
+++ b/docs/intro/tutorial04.txt
@@ -20,7 +20,7 @@ tutorial, so that the template contains an HTML ``