我尝试使用重定向快捷方式发出重定向,但我收到以下错误
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)),
)
答案 0 :(得分:1)
您的网址模式似乎有些奇怪,请尝试:
url(r'^(.*)$', redirect('macmonster.views.home')),