我正在使用 Django 并且无法加载静态文件,错误是:
ImproperlyConfigured: The storage backend of the staticfiles finder <class 'django.contrib.staticfiles.finders.DefaultStorageFinder'> doesn't have a valid location.
这是views.py:
def results(request):
metaUrl = ""
if not request.method == 'POST':
print "Not Post!"
else:
metaUrl = request.POST['urls']
cmodel = InfoController()
(firstList, wordList, sizeList) = cmodel.controller(metaUrl)
print "I am at result"
return render( request, 'infoRetriever/results.html', { 'firstList': firstList, 'wordList': wordList, 'sizeList': sizeList})
奇怪的是,当我使用
return render_to_response('infoRetriever/results.html', { 'firstList': firstList, 'wordList': wordList, 'sizeList': sizeList}, context_instance=RequestContext(request))
替换views.py中的最后一句,静态文件加载正常,但会出现其他问题。有人可以帮我吗?非常感谢。