2

リダイレクトショートカットを使用してリダイレクトを発行しようとしていますが、次のエラーが発生します

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)),
)
4

1 に答える 1

2

あなたのURLパターンは少し奇妙に思えます、試してみてください:

url(r'^(.*)$', redirect('macmonster.views.home')),
于 2013-02-20T21:44:56.783 に答える