开发者

Django-CMS, how to resolve a named apphook URL from a management command?

开发者 https://www.devze.com 2023-03-14 10:25 出处:网络
I开发者_开发知识库\'ve got a management command which sends email. In this email, I\'d like to include a URL to a signup form, which is an apphook module in the CMS.

I开发者_开发知识库've got a management command which sends email. In this email, I'd like to include a URL to a signup form, which is an apphook module in the CMS.

How can I resolve the URL to that path?

From the management command, I only see the plain URLconf, without the changes made by Django-CMS.


Solved my problem. It turns out that the pages may not appear in the URLconf (or urlpatterns), but the reverse() will work nevertheless.

The pagename does have to be fixed with the language code. For example:

reverse('nl:my-profile')

And the cms.appresolvers module will do it's work to find the page.

0

精彩评论

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