Django: 设置用户个人资料页面?
Django: 设置用户个人资料页面?
我还是一个新手,不确定应该如何为用户设置个人资料页面。 django.contrib.auth.views.login
会重定向到一个 accounts/profile
页面,但我应该如何实际设置它呢?
是不是通常只需在 urls.py
中定义 accounts/profile
并将其重定向到一个模板,还是有更复杂的模式?
django.views.generic.simple.direct_to_template, {'template':'profile.html'})
其中 profile.html
位于 PROJECT_ROOT/templates/profile.html
,并扩展了 base.html
?
问题的原因是用户需要设置一个用户个人资料页面。解决方法是使用可重复使用的应用程序来处理常见的个人资料页面功能。可以参考以下链接来查看一些可重复使用的应用程序:https://bitbucket.org/ubernostrum/django-profiles/wiki/Home 或者 http://code.google.com/p/django-profile/