如何从my_app.views调用changelist_view?我需要将渲染HTML保存到文件/ db
def view_to_string(self, request, extra_context=None):
from django.template.loader import render_to_string
from django.http import HttpResponse
import codecs
file = super(ProjectAdmin, self).changelist_view(request, extra_context=Non
f = codecs.open('/home/django/workfile', 'w', encoding="UTF-8")
f.write(str(file).decode("utf8"))
f.close()