简体   繁体   中英

NoReverseMatch(u"Reverse for 'rz' with arguments '()' and keyword arguments?

I Want to use url of an app( rz ) using named urls and 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/$']",)`

In db shell I checked

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

What am I missing ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM