Skip to content

Instantly share code, notes, and snippets.

@jgram925
Created August 30, 2019 17:06
Show Gist options
  • Save jgram925/76dae3e7838bfb4025bf14bc6beead09 to your computer and use it in GitHub Desktop.
Save jgram925/76dae3e7838bfb4025bf14bc6beead09 to your computer and use it in GitHub Desktop.
z3c.rml QR Codes.md

In the view

Use the build_absolue_uri to get the server address regardless of any changes.

qr_code = request.build_absolute_uri('/pms/{}'.format(pk))

Pass the 'qr_code' variable into the context.

On the PDF template

Call the 'qr_code' context in the barCodeFlowable tag's value atribute.

<barCodeFlowable code="qr" height="1in" width="1in" value="{{ qr_code }}"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment