Fixed #14524, #14582, #14617, #14665 and #14667 -- Tweaked staticfiles app.

* Updated StaticFilesHandler and AdminMediaHandler
  to make use of the 404 handler if needed.

* Updated runserver management command to serve static files
  only in DEBUG mode (or if specified the --insecure option)
  and if the staticfiles app is in INSTALLED_APPS. Also added
  an option to disable serving completely (--nostatic).

* Added check in debug mode if STATICFILES_* settings are
  different to MEDIA_* settings.

* Removed a faulty PendingDeprecationWarning in AdminMediaHandler
  that is triggered every time runserver is used.

* Fixed an issue with the modification time checks when
  running collectstatic.

* Extended and refined documentation.

Thanks to everyone for input, especially to Carl Meyer, Ted Kaemming and
Adam Vandenberg for patches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2010-11-11 21:43:49 +00:00
parent 216fdfab61
commit 8e96584f63
14 changed files with 190 additions and 78 deletions

View file

@ -681,6 +681,31 @@ Example usage::
django-admin.py runserver --noreload
.. django-admin-option:: --nostatic
Use the ``--nostatic`` option to disable serving of static files with the
:doc:`staticfiles </ref/contrib/staticfiles>` app entirely.
Example usage::
django-admin.py runserver --nostatic
.. django-admin-option:: --insecure
Use the ``--insecure`` option to force serving of static files with the
:doc:`staticfiles </ref/contrib/staticfiles>` app even if the :setting:`DEBUG`
setting is ``False``. By using this you acknoledge the fact that it's
**grossly inefficient** and probably **insecure**. This is only intended for
local development, and should **never be used in production**.
See the :doc:`reference documentation of the app </ref/contrib/staticfiles>`
for more details and learn how to :doc:`manage and deploy static files
</howto/static-files>` correctly.
Example usage::
django-admin.py runserver --insecure
Examples of using different ports and addresses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~