Skip to content

Commit

Permalink
Fixed #18397 -- Avoided referencing lawrence.com.
Browse files Browse the repository at this point in the history
This commit includes multiple small related changes, see the ticket
for a full discussion.
  • Loading branch information
aaugustin committed Jun 7, 2012
1 parent 4ce5a5f commit 17f3e92
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions django/conf/global_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,19 +270,19 @@
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com/media/"
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = ''

# Absolute path to the directory that holds static files.
# Example: "/home/media/media.lawrence.com/static/"
# Absolute path to the directory static files should be collected to.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = ''

# URL that handles the static files served from STATIC_ROOT.
# Example: "http://media.lawrence.com/static/"
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = None

# List of upload handler classes to be applied in order.
Expand Down Expand Up @@ -451,7 +451,7 @@

SESSION_COOKIE_NAME = 'sessionid' # Cookie name. This can be whatever you want.
SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # Age of cookie, in seconds (default: 2 weeks).
SESSION_COOKIE_DOMAIN = None # A string like ".lawrence.com", or None for standard domain cookie.
SESSION_COOKIE_DOMAIN = None # A string like ".example.com", or None for standard domain cookie.
SESSION_COOKIE_SECURE = False # Whether the session cookie should be secure (https:// only).
SESSION_COOKIE_PATH = '/' # The path of the session cookie.
SESSION_COOKIE_HTTPONLY = True # Whether to use the non-RFC standard httpOnly flag (IE, FF3+, others)
Expand Down
8 changes: 4 additions & 4 deletions django/conf/project_template/project_name/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = ''

# 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: "/var/www/example.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'

# Additional locations of static files
Expand Down
6 changes: 3 additions & 3 deletions django/contrib/messages/tests/cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def stored_cookie_messages_count(storage, response):
return len(data)


@override_settings(SESSION_COOKIE_DOMAIN='.lawrence.com')
@override_settings(SESSION_COOKIE_DOMAIN='.example.com')
class CookieTest(BaseTest):
storage_class = CookieStorage

Expand All @@ -65,7 +65,7 @@ def test_domain(self):
storage.add(constants.INFO, 'test')
storage.update(response)
self.assertTrue('test' in response.cookies['messages'].value)
self.assertEqual(response.cookies['messages']['domain'], '.lawrence.com')
self.assertEqual(response.cookies['messages']['domain'], '.example.com')
self.assertEqual(response.cookies['messages']['expires'], '')

# Test after the messages have been consumed
Expand All @@ -76,7 +76,7 @@ def test_domain(self):
pass # Iterate through the storage to simulate consumption of messages.
storage.update(response)
self.assertEqual(response.cookies['messages'].value, '')
self.assertEqual(response.cookies['messages']['domain'], '.lawrence.com')
self.assertEqual(response.cookies['messages']['domain'], '.example.com')
self.assertEqual(response.cookies['messages']['expires'], 'Thu, 01-Jan-1970 00:00:00 GMT')

def test_get_bad_cookie(self):
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/contrib/csrf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ Default: ``None``
The domain to be used when setting the CSRF cookie. This can be useful for
easily allowing cross-subdomain requests to be excluded from the normal cross
site request forgery protection. It should be set to a string such as
``".lawrence.com"`` to allow a POST request from a form on one subdomain to be
``".example.com"`` to allow a POST request from a form on one subdomain to be
accepted by a view served from another subdomain.

Please note that, with or without use of this setting, this CSRF protection
Expand Down
12 changes: 6 additions & 6 deletions docs/ref/settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Default: ``None``
The domain to be used when setting the CSRF cookie. This can be useful for
easily allowing cross-subdomain requests to be excluded from the normal cross
site request forgery protection. It should be set to a string such as
``".lawrence.com"`` to allow a POST request from a form on one subdomain to be
``".example.com"`` to allow a POST request from a form on one subdomain to be
accepted by accepted by a view served from another subdomain.

Please note that the presence of this setting does not imply that Django's CSRF
Expand Down Expand Up @@ -1404,7 +1404,7 @@ Default: ``''`` (Empty string)
Absolute path to the directory that holds media for this installation, used
for :doc:`managing stored files </topics/files>`.

Example: ``"/home/media/media.lawrence.com/"``
Example: ``"/var/www/example.com/media/"``

See also :setting:`MEDIA_URL`.

Expand All @@ -1418,7 +1418,7 @@ Default: ``''`` (Empty string)
URL that handles the media served from :setting:`MEDIA_ROOT`, used
for :doc:`managing stored files </topics/files>`.

Example: ``"http://media.lawrence.com/"``
Example: ``"http://media.example.com/"``

.. versionchanged:: 1.3
It must end in a slash if set to a non-empty value.
Expand Down Expand Up @@ -1704,7 +1704,7 @@ SESSION_COOKIE_DOMAIN
Default: ``None``

The domain to use for session cookies. Set this to a string such as
``".lawrence.com"`` for cross-domain cookies, or use ``None`` for a standard
``".example.com"`` for cross-domain cookies, or use ``None`` for a standard
domain cookie. See the :doc:`/topics/http/sessions`.

.. setting:: SESSION_COOKIE_HTTPONLY
Expand Down Expand Up @@ -1885,7 +1885,7 @@ Default: ``''`` (Empty string)
The absolute path to the directory where :djadmin:`collectstatic` will collect
static files for deployment.

Example: ``"/home/example.com/static/"``
Example: ``"/var/www/example.com/static/"``

If the :doc:`staticfiles</ref/contrib/staticfiles>` contrib app is enabled
(default) the :djadmin:`collectstatic` management command will collect static
Expand Down Expand Up @@ -1915,7 +1915,7 @@ Default: ``None``

URL to use when referring to static files located in :setting:`STATIC_ROOT`.

Example: ``"/site_media/static/"`` or ``"http://static.example.com/"``
Example: ``"/static/"`` or ``"http://static.example.com/"``

If not ``None``, this will be used as the base path for
:ref:`media definitions<form-media-paths>` and the
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/http/sessions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ SESSION_COOKIE_DOMAIN
Default: ``None``

The domain to use for session cookies. Set this to a string such as
``".lawrence.com"`` (note the leading dot!) for cross-domain cookies, or use
``".example.com"`` (note the leading dot!) for cross-domain cookies, or use
``None`` for a standard domain cookie.

SESSION_COOKIE_HTTPONLY
Expand Down

0 comments on commit 17f3e92

Please sign in to comment.