简体   繁体   中英

Django 1.3 get_absolute_url and localeurl

I am using Django 1.3 in my project and switching away from the javascript i18n function to localeurl.

Really handy although I am stuck with my get_absolute_url().

Everytime I try and call up a page it defaults to the default language, even if I have selected another one.

is there a workaround for get_absolute_url() to incorprate the existing language code?

Try whith this:

from django.utils.translation import get_language
get_language()

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