Full-stack web applications developer

Avoiding DeprecationWarning messages in your Apache logs

October 18, 2013Arthur Pemberton0 Comments

I recently upgraded a Django project from 1.4.x to 1.5.1, along with that came the anticipated change to ‘django.conf.urls’ which gives a deprecation warning on every request:

/usr/lib/python2.6/site-packages/Django-1.5.1-py2.6.egg/django/conf/urls/ DeprecationWarning: django.conf.urls.defaults is deprecated; use django.conf.urls instead

After clearing up all the warnings in my project, and using grep to verify, I was still getting these warnings. Short on time, but not wanting my Apache error logs to fill up unnecessarily, I sought out a “fix” and found this mod_wsgi option, which happens to be what I use to serve my Django apps via Apache HTTPd.

The option in question is WSGIPythonWarnings ignore, specifically in my case:

WSGIPythonWarnings ignore::DeprecationWarning::

One thing to be aware of that this directive is expected in the global context, and not (for example) in the <VirtualHost>

Leave a Reply