Monday, January 7, 2013

Re: django.conf.urls.defaults is deprecated

This could be happening in some app that you have pip installed (or equivalent) and
are using in installed apps, or which is being included by some app that is.

You could find-grep in your virtualenv's site-packages for 'default' and pass the result
into grep 'urls', and if necessary, into  grep 'conf'.

Another approach is to stick in a set_trace() where the warning is getting triggered or
(since this is presumably your only deprecation warning) where it is getting printed,
and 'u' your way up the stack to see who's importing it, and, if necessary, what they
are being imported, etc.

Having found the source, you could then:
  See if there is a newer version with it fixed
  Patch it yourself (and submit the patch to the maintainer)
  Or live with it -- for now it's only a deprecation warning.  You will have to find it if you
     upgrade Django to the point that it fails.

Bill

On Mon, Jan 7, 2013 at 1:13 PM, Thiago Carvalho D' Ávila <thiagocavila@gmail.com> wrote:
Nope. If I grep my entire project folder with: grep "defaults" . -r, the only result is:
Binary file ./settings.pyc matches

Then I delete it, and runserver again, I get the message:
/virtualenvs/env-hrp-rc/local/lib/python2.7/site-packages/django/conf/urls/defaults.py:3: DeprecationWarning: django.conf.urls.defaults is deprecated; use django.conf.urls instead
  DeprecationWarning)

And the compiled settings.py continue to match =(

2013/1/6 nkryptic <nkryptic@gmail.com>
In your urls.py file, you probably have something like:
from django.conf.urls.defaults import patterns, url, include

change that to:
from django.conf.urls import patterns, url, include


On Sunday, January 6, 2013 9:57:25 AM UTC-5, Thiago wrote:
Hello,

I am having this "DeprecationWarning: django.conf.urls.defaults is deprecated; use django.conf.urls instead" when I runserver.. but there is no reference to django.conf.urls.defaults. Any hint of what should I do to take it off?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/PfNMQ3NFctYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment