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

AttributeError: 'SolidLocaleRegexURLResolver' object has no attribute 'prefix_default_language' #40

Open
jorenham opened this issue Jan 31, 2017 · 2 comments

Comments

@jorenham
Copy link

jorenham commented Jan 31, 2017

After upgrading from Django 1.9.12 to 1.10.5, my project won't run anymore with the traceback:

Internal Server Error: /
Traceback (most recent call last):
  File "/home/joren/workspace/myproject/lib/python3.4/site-packages/django/core/handlers/base.py", line 131, in get_response
    response = middleware_method(request, response)
  File "/home/joren/workspace/myproject/lib/python3.4/site-packages/django/middleware/locale.py", line 36, in process_response
    i18n_patterns_used, prefixed_default_language = is_language_prefix_patterns_used(urlconf)
  File "/home/joren/workspace/myproject/lib/python3.4/functools.py", line 448, in wrapper
    result = user_function(*args, **kwds)
  File "/home/joren/workspace/myproject/lib/python3.4/site-packages/django/conf/urls/i18n.py", line 31, in is_language_prefix_patterns_used
    return True, url_pattern.prefix_default_language
AttributeError: 'SolidLocaleRegexURLResolver' object has no attribute 'prefix_default_language'
[31/Jan/2017 13:03:57] "GET / HTTP/1.1" 500 82666

I'm using the setting SOLID_I18N_USE_REDIRECTS = True and it all seems to work fine at Django 1.9.12. What's going on here?

@st4lk
Copy link
Owner

st4lk commented Jan 31, 2017

Hi Jorem, thanks for catching that!
Looks like a bug, will try to discover in more details soon.

st4lk added a commit that referenced this issue Feb 4, 2017
st4lk added a commit that referenced this issue Feb 4, 2017
st4lk added a commit that referenced this issue Feb 4, 2017
Fix url resolver inheritance [refs #40]
@st4lk
Copy link
Owner

st4lk commented Feb 4, 2017

Fixed possibly related issue and uploaded new version v1.4.1.
But very likely you faced this exception because you have

'django.middleware.locale.LocaleMiddleware'

In the list of your MIDDLEWARE_CLASSES. If you want to use this package, you must remove it.
Also, check deprecation notice.

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