Login

Tag "beautiful-soup"

Snippet List

Pretty Print Template Tag

This defines a new template tag that lets you print your rendered templates (or partial templates) in html that has been prettified by beautiful soup. It is dependent on the beautiful soup library (bs4). Not recommended for production but it is helpful for development and serving readable html. {% load whatever_template_file %}' <body> {% pretty %} <h1>Hello, world.</h1> {% endpretty %} </body>

  • beautiful-soup
  • template-tag
  • pretty-print
Read More

Whore links

Finds links from a body of html so you can display them elsewhere.

  • beautiful-soup
  • links
Read More

2 snippets posted so far.