Login

Tag "print"

Snippet List

Interactive debugger and other Paste niceties

runserver with extra development tools: 1. interactive debugger that pops up automatically if an exception occurs, courtesy of [Werkzeug](http://werkzeug.pocoo.org/documentation/dev/debug.html#using-the-debugger) 2. logging of print statements directly into HTML (div float), courtesy of [Paste](http://pythonpaste.org/modules/debug.prints.html). Credits: [piranha.org.ua](http://piranha.org.ua/)

  • print
  • django
  • debugging
  • paste
  • wsgi
  • werkzeug
Read More

Print Exceptions to the Console

Put this in an __init__.py somewhere that will be executed on initialization and all errors will be printed out to stderr. Useful for debugging Facebook apps, javascript calls, etc.

  • print
  • console
  • exception
  • signal
Read More

Add a print link to the admin to print individual record

This is a view that can be used to add a print button (link) in the admin change form for an individual record. Pretty simple to use. A nice enhancement to it is to be able to pull the model field name tie with the field value, something like making {{ object.as_dl }} available to the template. PS: The code is a modification from the django.views.generic.list_detail.object_detail

  • print
  • admin
  • record
Read More

Create OpenOffice documents

This view will enable you to generate OpenOffice documents from templates written in OpenOffice 2.x Just make sure that there is no OO tag in between your code (no change in formatting etc.). content.xml is a valid XML file, so you can do some preprocessing using xml.dom.minidom. I would also recommend caching (just save the zip file without content.xml and content.xml on its own).

  • print
  • odf
  • office
Read More

4 snippets posted so far.