0
我想修改url来访问用户配置文件。 OSQA使用permalink()生成个人资料网址
默认链接http://meta.osqa.net/users/2836/nhatthinh
我想将其更改为http://meta.osqa.net/users/nhatthinh
所以,我修改功能get_profile_url如下:如何修改链接以访问用户配置文件?
@models.permalink
def get_profile_url(self):
return ('user_profile', [slugify(self.username)])
而且我也修改forum \ urls.py中的网址为:
url(r'^%s/(.*)/$' % _('users/'), app.users.user_profile, name='user_profile'),
但结果不符合我的预期。
OSQA生成的链接是http://meta.osqa.net/users//nhatthinh 那么,我该如何解决这个问题呢?
非常感谢。
谢谢schacki。没关系。 –