Ticket #19875: 19875.2.diff

File 19875.2.diff, 2.4 KB (added by Tim Graham, 5 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 
    2525TEMPLATE_DEBUG = True
     27# required if DEBUG is False
    2728ALLOWED_HOSTS = []
  • 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".
     476.. warning::
     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', '']`` for
     481    local development).
    476483A couple more things to note about 404 views:
    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.
     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)".
    855859.. _django/views/debug.py: https://github.com/django/django/blob/master/django/views/debug.py
    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')
     20.. note::
     22    If you set :setting:`DEBUG` to ``False``, you also need to properly set
     23    the :setting:`ALLOWED_HOSTS` setting.
    2025Because a settings file is a Python module, the following apply:
    2227* It doesn't allow for Python syntax errors.
Back to Top