Django重定向快捷方式

时间:2013-02-20 21:38:51

标签: python django

我尝试使用重定向快捷方式发出重定向,但我收到以下错误

raise ImproperlyConfigured("The included urlconf %s doesn't have any patterns in it" % self.urlconf_name)
ImproperlyConfigured: The included urlconf webtools.urls doesn't have any patterns in it

我的urls.py文件如下所示:

from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
from django.views.generic.base import RedirectView
from django.shortcuts import redirect

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
 url(r'^.*$', redirect(macmonster.views.home)),
)

1 个答案:

答案 0 :(得分:1)

您的网址模式似乎有些奇怪,请尝试:

url(r'^(.*)$', redirect('macmonster.views.home')),