Kaydet (Commit) 76fb2bb0 authored tarafından Carl Meyer's avatar Carl Meyer

Fixed some documentation and default-settings.py comments that were misleading…

Fixed some documentation and default-settings.py comments that were misleading about the purpose of STATIC_ROOT, and removed an unused import.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15384 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 9a82eb6f
...@@ -52,21 +52,27 @@ MEDIA_ROOT = '' ...@@ -52,21 +52,27 @@ MEDIA_ROOT = ''
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '' MEDIA_URL = ''
# Absolute path to the directory that holds static files. # Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/" # Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = '' STATIC_ROOT = ''
# URL that handles the static files served from STATIC_ROOT. # URL prefix for static files.
# Example: "http://media.lawrence.com/static/" # Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/' STATIC_URL = '/static/'
# URL prefix for admin media -- CSS, JavaScript and images. # URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash. # Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/". # Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/' ADMIN_MEDIA_PREFIX = '/static/admin/'
# A list of locations of additional static files # Additional locations of static files
STATICFILES_DIRS = () STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
# List of finder classes that know how to find static files in # List of finder classes that know how to find static files in
# various locations. # various locations.
......
import os import os
from django.conf import settings from django.conf import settings
from django.db import models
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.datastructures import SortedDict from django.utils.datastructures import SortedDict
......
...@@ -26,8 +26,6 @@ Settings ...@@ -26,8 +26,6 @@ Settings
.. note:: .. note::
The following settings control the behavior of the staticfiles app. The following settings control the behavior of the staticfiles app.
Configuring the global settings :setting:`STATIC_ROOT` and
:setting:`STATIC_URL` is **required**.
.. setting:: STATICFILES_DIRS .. setting:: STATICFILES_DIRS
......
...@@ -1628,22 +1628,24 @@ STATIC_ROOT ...@@ -1628,22 +1628,24 @@ STATIC_ROOT
Default: ``''`` (Empty string) Default: ``''`` (Empty string)
The absolute path to the directory that contains static files. The absolute path to the directory where :djadmin:`collectstatic` will collect
static files for deployment.
Example: ``"/home/example.com/static/"`` Example: ``"/home/example.com/static/"``
If the :doc:`staticfiles</ref/contrib/staticfiles>` contrib app is enabled If the :doc:`staticfiles</ref/contrib/staticfiles>` contrib app is enabled
(default) this will be used as the directory which the (default) the :djadmin:`collectstatic` management command will collect static
:djadmin:`collectstatic` management command collects static files in. See files into this directory. See the howto on :doc:`managing static
the howto on :doc:`managing static files</howto/static-files>` for more files</howto/static-files>` for more details about usage.
details about usage.
.. warning:: This should be an (initially empty) destination directory for
.. warning:: This is not a place to store your static files permanently; collecting your static files from their permanent locations into one
you should do that in directories that will be found by directory for ease of deployment; it is **not** a place to store your
:doc:`staticfiles</ref/contrib/staticfiles>`'s static files permanently. You should do that in directories that will be
found by :doc:`staticfiles</ref/contrib/staticfiles>`'s
:setting:`finders<STATICFILES_FINDERS>`, which by default, are :setting:`finders<STATICFILES_FINDERS>`, which by default, are
``'static'`` app sub directories and any directories you include in ``'static/'`` app sub-directories and any directories you include in
the :setting:`STATICFILES_DIRS`). :setting:`STATICFILES_DIRS`).
See :doc:`staticfiles reference</ref/contrib/staticfiles>` and See :doc:`staticfiles reference</ref/contrib/staticfiles>` and
:setting:`STATIC_URL`. :setting:`STATIC_URL`.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment