Login

Tag "subprocess"

Snippet List

Use git log to give your app a revision

Put that stuff in your settings.py Then you can use the git log last date to make that your "revision number" assuming you don't use regular version release numbers. With it you can do something like: <div id="footer"> &copy; My Company &mdash; The Super App (revision {{ GIT_REVISION_DATE }}) </div> See if you like it

  • settings
  • subprocess
  • git
Read More

Download images as png or pdf

This is an example of how I am providing downloads of dynamic images in either PNG or PDF formats. The PDF format requires ImageMagick's `convert`, and temporary disk space to save the intermediary image. If anyone knows a way to avoid writing to disk, I'd be happy to include it here. I realize there may be uses where it isn't necessary to use the PIL Image class if the image is already stored as a file. This is used for downloading dynamic images without saving them to disk (unless pdf format is used).

  • pdf
  • png
  • custom-response
  • subprocess
Read More

2 snippets posted so far.