NoReverseMatch(你“使用参数'()'和关键字参数反转'rz'?

时间:2022-06-04 23:20:25

I Want to use url of an app(rz) using named urls and reverse.

我想使用名为urls的app(rz)的url和reverse。

My Views.py

return reverse('rz')

My Urls.py

urlpatterns = solid_i18n_patterns(

    url(r'^rz/$', rzV.as_view(), name="rz")  
)

The error I am getting

我得到的错误

NoReverseMatch(u"Reverse for 'rz' with arguments '()' 1 pattern(s) tried: ['rz/$']",)`

NoReverseMatch(u“反转'rz'与参数'()'1模式尝试:['rz / $']”,)`

In db shell I checked

在db shell中我检查过

>>> reverse('rz')  
u'/None/rz/'

What am I missing ?

我错过了什么?

1 个解决方案

#1


0  

If you are using https://github.com/st4lk/django-solid-i18n-urls you need to set the LANGUAGE_CODE default.

如果您使用https://github.com/st4lk/django-solid-i18n-urls,则需要设置LANGUAGE_CODE默认值。

#1


0  

If you are using https://github.com/st4lk/django-solid-i18n-urls you need to set the LANGUAGE_CODE default.

如果您使用https://github.com/st4lk/django-solid-i18n-urls,则需要设置LANGUAGE_CODE默认值。