Django 1.9 to 1.10 increments NoReverseMatch: u'en-gb 'is not a registered namespace

I am trying to upgrade my application 1.9 to 1.10 and I get the following error while running all my unit tests:

Traceback (most recent call last):   File "/home/…/tests/views/test_configurator.py", line 261, in test_view_configurator_post
    args=[self.configurator.id]),   File "/home/…/.virtualenvs/intranet/lib/python2.7/site-packages/django/urls/base.py", line 87, in reverse
    raise NoReverseMatch("%s is not a registered namespace" % key) NoReverseMatch: 'en-gb' is not a registered namespace

My setting.pyfile contains the following:

LANGUAGE_CODE = 'en-gb'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
TIME_ZONE = 'Europe/London'

What am I missing?

+4
source share
5 answers

I upgraded to django 1.10.5 and the problem disappeared.

Follow the figure!

+1
source

I also ran into this, and I narrowed down the reason. I think this is a regression in Django, but I don’t have time to write a full error report. Here is what I know.

Django , django.urls.reverse dict.

. a populating , True , reverse. django.urls.reverse, .

URL- - urls.py, . - , . undefined , True. , , , .

django.urls.reverse NoReverseMatch en-us. , , populating , dict, , KeyError en-us, NoReverseMatch en-us.

, NoReverseMatch, . , , , . Django, . , populating False , .

+8

django, :

python manage.py check
+1

, urls.py urls.py, $. urlresolvers. URL- , .

, - - , URL-.

0

LANGUAGE_CODE en_gb. . en-gb.

-2

Source: https://habr.com/ru/post/1657066/


All Articles