Ticket #19875: 19875.2.diff

File 19875.2.diff, 2.4 KB (added by Tim Graham, 11 years ago)
  • django/conf/project_template/project_name/settings.py

    diff --git a/django/conf/project_template/project_name/settings.py b/django/conf/project_template/project_name/settings.py
    index efe8091..15d2991 100644
    a b DEBUG = True  
    2424
    2525TEMPLATE_DEBUG = True
    2626
     27# required if DEBUG is False
    2728ALLOWED_HOSTS = []
    2829
    2930
  • docs/intro/tutorial03.txt

    diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt
    index 1203691..6193ec4 100644
    a b template for all 404 errors when :setting:`DEBUG` is set to ``False`` (in your  
    473473settings module). If you do create the template, add at least some dummy
    474474content like "Page not found".
    475475
     476.. warning::
     477
     478    If :setting:`DEBUG` is set to ``False``, all responses will be
     479    "Bad Request (400)" unless you specify the proper :setting:`ALLOWED_HOSTS`
     480    as well (something like ``['localhost', '127.0.0.1']`` for
     481    local development).
     482
    476483A couple more things to note about 404 views:
    477484
    478485* If :setting:`DEBUG` is set to ``True`` (in your settings module) then your
  • docs/ref/settings.txt

    diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
    index b8ebc16..748b2bf 100644
    a b It is also important to remember that when running with :setting:`DEBUG`  
    852852turned on, Django will remember every SQL query it executes. This is useful
    853853when you're debugging, but it'll rapidly consume memory on a production server.
    854854
     855Finally, if :setting:`DEBUG` is ``False``, you also need to properly set
     856the :setting:`ALLOWED_HOSTS` setting. Failing to do so will result in all
     857requests being returned as "Bad Request (400)".
     858
    855859.. _django/views/debug.py: https://github.com/django/django/blob/master/django/views/debug.py
    856860
    857861.. setting:: DEBUG_PROPAGATE_EXCEPTIONS
  • docs/topics/settings.txt

    diff --git a/docs/topics/settings.txt b/docs/topics/settings.txt
    index fa26297..1cfcd26 100644
    a b Here are a couple of example settings::  
    1717    DEFAULT_FROM_EMAIL = 'webmaster@example.com'
    1818    TEMPLATE_DIRS = ('/home/templates/mike', '/home/templates/john')
    1919
     20.. note::
     21
     22    If you set :setting:`DEBUG` to ``False``, you also need to properly set
     23    the :setting:`ALLOWED_HOSTS` setting.
     24
    2025Because a settings file is a Python module, the following apply:
    2126
    2227* It doesn't allow for Python syntax errors.
Back to Top