Django导出主要使用render_to_string方法来进行;

可以参考的源码如下:

对应的渲染article.html

运行的时候,python manage.py shell,然后导入export 包即可。