# Django # the user's URLs setting problem occurs after you use USERPROFILE, the get_absolute_url of user model is/users/<username>/by default in Django's auth app. If you have extended and implemented a USERPROFILE, you may need to use USERPROFILE. to use get_absolute_url, You need to redefine Auth. the user's absolute URL.
The get_absolute_url of user in auth. models is defined as follows:
def get_absolute_url(self): return "/users/%s/" % urllib.quote(smart_str(self.username))
Here it is fixed, but Django still gives a method to modify it.
The method is: Add a setting in settings. py: absolute_url_overrides
ABSOLUTE_URL_OVERRIDES = { 'blogs.weblog': lambda o: "/blogs/%s/" % o.slug, 'news.story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug),}
Therefore, for Auth. User, modify the parameters as follows:
Absolute_url_overrides = {'auth. user': Lambda U: "/member/profile/% S/" % u. username, # other settings}
Official documents: https://docs.djangoproject.com/en/1.1/ref/settings/#absolute-url-overrides
Https://code.djangoproject.com/wiki/ReplacingGetAbsoluteUrl