您现在的位置: 365建站网 > 365学习 > Adding new feature about the URL suffix definition of an App

Adding new feature about the URL suffix definition of an App

文章来源:365jz.com     点击数:242    更新时间:2009-10-14 10:50   参与评论

You know, Uliweb uses expose() to define url, for example:

@expose('/index')

But when you want to change the url suffix for an App, you should edit every views file(of cause you can use static urls.py appoach, but I won't talk about it now). Fox example how to change '/wiki/*' to '/mywiki/*'? So I add this new feature to Uliweb, so that you can define the URL suffix for an App, just adding an entry to URL session, for example:

[URL]
wiki = '/wiki'

If you didn't define an entry for wiki app, all urls in wiki app won't be changed at all. But if you define wiki='/wiki' in settings, all urls in wiki app will be added '/wiki' automatically, even though the urls is started with '/'. So '/index' will be converted to '/wiki/index'. So for above problem, you can just change wiki='/mywiki'.

And the entry key will be the appname, it's the same with app module name, for example: uliweb.contrib.admin, etc.

So in this feature, you can easily change an app URL suffix.

如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛

发表评论 (242人查看0条评论)
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
昵称:
最新评论
------分隔线----------------------------

快速入口

· 365软件
· 建站公司
· 杰创官网
· 建站工具

业务咨询

· 技术支持
· 服务时间:9:00-18:00
365建站网二维码

Powered by 365建站网 RSS地图 HTML地图

copyright © 2013-2022 版权所有 鄂ICP备17013400号-1