diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index c4a0b78..ad90e19 100644
a
|
b
|
class Command(BaseCommand):
|
84 | 84 | from django.conf import settings |
85 | 85 | from django.utils import translation |
86 | 86 | |
| 87 | if not settings.DEBUG and not settings.ALLOWED_HOSTS: |
| 88 | self.stderr.write('You must set settings.ALLOWED_HOSTS if DEBUG is False.') |
| 89 | sys.exit(1) |
| 90 | |
87 | 91 | threading = options.get('use_threading') |
88 | 92 | shutdown_message = options.get('shutdown_message', '') |
89 | 93 | quit_command = 'CTRL-BREAK' if sys.platform == 'win32' else 'CONTROL-C' |
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
|
473 | 473 | settings module). If you do create the template, add at least some dummy |
474 | 474 | content like "Page not found". |
475 | 475 | |
| 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 | |
476 | 483 | A couple more things to note about 404 views: |
477 | 484 | |
478 | 485 | * If :setting:`DEBUG` is set to ``True`` (in your settings module) then your |
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index ef52d31..897af27 100644
a
|
b
|
It is also important to remember that when running with :setting:`DEBUG`
|
852 | 852 | turned on, Django will remember every SQL query it executes. This is useful |
853 | 853 | when you're debugging, but it'll rapidly consume memory on a production server. |
854 | 854 | |
| 855 | Finally, if :setting:`DEBUG` is ``False``, you also need to properly set |
| 856 | the :setting:`ALLOWED_HOSTS` setting. Failing to do so will result in all |
| 857 | requests being returned as "Bad Request (400)". |
| 858 | |
855 | 859 | .. _django/views/debug.py: https://github.com/django/django/blob/master/django/views/debug.py |
856 | 860 | |
857 | 861 | .. setting:: DEBUG_PROPAGATE_EXCEPTIONS |
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::
|
17 | 17 | DEFAULT_FROM_EMAIL = 'webmaster@example.com' |
18 | 18 | TEMPLATE_DIRS = ('/home/templates/mike', '/home/templates/john') |
19 | 19 | |
| 20 | .. note:: |
| 21 | |
| 22 | If you set :setting:`DEBUG` to ``False``, you also need to properly set |
| 23 | the :setting:`ALLOWED_HOSTS` setting. |
| 24 | |
20 | 25 | Because a settings file is a Python module, the following apply: |
21 | 26 | |
22 | 27 | * It doesn't allow for Python syntax errors. |