Alex Rivera | Logout

how do I get django runserver to show me DeprecationWarnings and other useful messages?

Asked 2011-07-16T18:57:30.887
17

I've recently updated my django installation from 1.2 to 1.3. On my developer system I didn't get any warnings about deprecated calls. But once I moved the code onto my production apache server, I saw many 'DeprecationWarning' messages in my apache logs. So how do I have to call runserver to these these messages too?

Currently I call it like this:

python manage.py runserver --verbosity 2
Edit
Report

1 Answer

1

The runserver command ignores the verbosity option: https://code.djangoproject.com/ticket/15132

I'd recommend setting up a logger and directing the output to stderr: https://docs.djangoproject.com/en/1.3/topics/logging/

For example:

import logging
logger = logging.getLogger('django')   # Django's catch-all logger
hdlr = logging.StreamHandler()   # Logs to stderr by default
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr) 
logger.setLevel(logging.WARNING)
answered 2011-07-16T19:34:32.800

Your Answer