This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) Create a middlewares/middlewares.py file and copy this: | |
import threading | |
class RequestMiddleware: | |
def __init__(self, get_response, thread_local=threading.local()): | |
self.get_response = get_response | |
self.thread_local = thread_local | |
# One-time configuration and initialization. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I place this in the public domain | |
# This only handles non-nested lists, emphasis, headings and horizontal rules (which are converted to page breaks) | |
# Sufficient for converting Markdown generated HTML to reportlab flowables... | |
import xml.sax as sax | |
def html_to_rl(html, styleSheet): | |
elements = list() |