开发者

In Django-CMS, how to redirect a page on a condition?

I'm using Django 1.3 with Django-CMS

I have a multilanguage page, with urls

/en/hello/world

/it/ciao/mondo

Both urls point to same page, different translations.

At present, if an user write

/it/hello/world

the italian page is presented

I do not want two urls for the same exact content, I'd like to redirect to

/it/ciao/mondo

I tried to use in a middleware

get_pag开发者_如何学Goe_from_request (after importing it from cms.utils.page_resolver )

to check that the page absolute url is equal to the requested url

but it always return None

How can I achieve what I want (or have get_page_from_request return something ? )

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜