Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django.conf.urls.defaults is deprecated in Django 1.4, removed in Django 1.6 #539

Closed
gavinwahl opened this issue Jan 31, 2013 · 4 comments
Closed

Comments

@gavinwahl
Copy link
Contributor

The functions in django.conf.urls.defaults were moved to django.conf.urls with a deprecation warning (https://docs.djangoproject.com/en/1.4/releases/1.4/#django-conf-urls-defaults). In the django development version, the module is removed completely.

This presents a problem with supporting 1.3 and 1.6 -- the same import can not be used in both versions. I'd like to be able to use mezzanine with 1.6, so how about something like this:

try:
    from django.conf.urls.defaults import patterns, include, url
except ImportError
    from django.conf.urls import patterns, include, url

This would work on Django 1.3-1.6. If this solution works for you, I am happy to write the patch.

@stephenmcd
Copy link
Owner

Thanks Gavin. Once Django 1.5 is out, we'll drop support for Django 1.3, so then we can just use the new format explicitly.

I don't think 1.5 is far off so not much point in using both until then I think.

Let's leave this issue open anyway until we've updated to the new format.

@ghost
Copy link

ghost commented Mar 20, 2013

Django 1.5 is now out ;)

@ghost
Copy link

ghost commented Mar 20, 2013

If you want Django 1.3-1.6 support, use rather: (no warning on Django >= 1.5)

try:
    from django.conf.urls import patterns, url
except ImportError:
    from django.conf.urls.defaults import patterns, url

@stephenmcd
Copy link
Owner

Nope we'll still definitely drop 1.3 asap, so we can do this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants