你可以尝试称为 RedirectView
`from django.views.generic.base import RedirectView
urlpatterns = patterns(‘’,
url(r’^$’, ‘macmonster.views.home’),
#url(r’^macmon_home$’, ‘macmonster.views.home’),
url(r’^macmon_output/$’, ‘macmonster.views.output’),
url(r’^macmon_about/$’, ‘macmonster.views.about’),
url(r’^.*$’, RedirectView.as_view(url=’
)`
请注意
url,
<url_to_home_view>你实际上需要如何指定url。
permanent=False将返回HTTP 302,而
permanent=True将返回HTTP 301。
或者,你可以使用 django.shortcuts.redirect



