Last active
December 15, 2023 21:41
-
-
Save czue/90e287c9818ae726f73f5850c1b00f7f to your computer and use it in GitHub Desktop.
A simple django template tag that lets you automatically render json from a python object
Thanks for the suggestion @mark0978 ! Updated.
Hello Cory Zue,
under which license do you offer this code snippet? Any easy permissive license?
Thanks in advance
Siegfried
sure, yeah do whatever you want with it! I don't know if a github comment is binding but feel free to consider it MIT
Thank you very much.
Siegfried
you need to import settings in order to use settings.debug
in line 58.
from django.conf import settings
oops, thanks! fixed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can make it a tiny bit better with this:
So that the JSON is minimal when in production and more readable when in DEBUG mode.