title: How to log Python warnings in a Django log file?
body: <p>I have a Django application that I am migrating from v1.8 to v1.10. In the process of doing this work, I ran my application via:</p>
  
  <p><code>python -Wall manage.py runserver</code></p>
  
  <p>Doing so causes a number of Python warnings to appear in my console. I'd like to have these warnings show up in my Django application log, so I can examine them later. I thought my application's log handler would catch these warnings, but it doesn't. The log handler looks like the following (as taken from settings.py):</p>
  
  <pre><code>LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'formatters': {
          'verbose': {
              'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
              'datefmt': "%d/%b/%Y %H:%M:%S"
          },
          'simple': {
              'format': '%(levelname)s %(message)s'
          },
      },
      'handlers': {
          'file': {
              'level': 'WARNING',
              'class': 'logging.FileHandler',
              'filename': 'myapp.log',
              'formatter': 'verbose'
          },
      },
      'loggers': {
          'django': {
              'handlers': ['file'],
              'propagate': True,
              'level': 'WARNING',
          },
          'myapp': {
              'handlers': ['file'],
              'level': 'WARNING',
          },
      }
  }
  </code></pre>
  
  <p>How can I capture Python warnings (with <code>-Wall</code>) in my Django log for examination later?</p>