How to Safely Pass Data to JavaScript in a Django Template
Passing data to JavaScript in your Django templates can be dangerous. Adam Johnson highlights several common but potentially insecure techniques and then demonstrates two better alternatives.