st4lk / django-solid-i18n-urls

[DEPRECATED] Use default language for urls without language prefix.
http://www.lexev.org/en/
Other
112 stars 29 forks source link

Django 1.10 #35

Closed adilkhash closed 7 years ago

adilkhash commented 8 years ago

Hello. Starting from version 1.10, Django has keyword argument _prefix_defaultlanguage in i18n_patterns() which controls whether to put default language prefix in the url or not, hence no need to use solid_i18n. I have created this issue in case if somebody experiences problems during upgrade to >= Django 1.10.

st4lk commented 8 years ago

Hi! Thanks for pointing out! Here is a link to release notes: https://docs.djangoproject.com/en/dev/releases/1.10/#internationalization

blopker commented 8 years ago

This probably isn't the right place, but thought someone else may find this useful: https://gist.github.com/blopker/bb9107249bc34dfd646aee48b1d5218e

It replicates the redirecting behavior from django-solid-i18n-urls but using native Django 1.10 with prefix_default_language. It probably doesn't work for all cases, but it's a start.

Basically with these settings:

SOLID_I18N_USE_REDIRECTS = True
SOLID_I18N_DEFAULT_PREFIX_REDIRECT = True

Anyway, thank you for django-solid-i18n-urls, it has been immensely helpful.

Damaged-Organic commented 8 years ago

Upgrading to Django 1.10 results in error:

ImportError: cannot import name 'patterns'

in:

File "/usr/local/lib/python3.5/dist-packages/solid_i18n/urls.py", line 3, in from django.conf.urls import patterns

Looks like the package is using deprecated method to define urlpatterns:

urlpatterns = patterns(
    # patterns...
)

instead of currently recommended list syntax:

urlpatterns = [
    # patterns...
]

Great package, but this issue won't let me painlessly update to 1.10.

adilkhash commented 8 years ago

@Kid-Binary With Django 1.10 you no longer need to use this package. Look at my first message at the top.

Damaged-Organic commented 8 years ago

Oh... I'm sorry, missed that. Your package is cool anyway and helped a lot in the past : )

st4lk commented 7 years ago

Guys, I've added deprecation notice in README. There are some settings in this package, that still can be useful. So I decided to update the code to support Django 1.10 as well.