Skip to content

Instantly share code, notes, and snippets.

@reidransom
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reidransom/556e4e031ec490f58e15 to your computer and use it in GitHub Desktop.
Save reidransom/556e4e031ec490f58e15 to your computer and use it in GitHub Desktop.

In your js:

;(function () {
    window.lcms = window.lcms || {}
    window.lcms.initSomething = function (config) {
        doStuffWith(config.var_name)
        $.ajax(config.whatever_url)
    }
}).call(this);

In your html:

{% block scripts %}
{{ block.super }}
<script>
lcms.initSomething({
    var_name: '{{ var_name }}',
    whatever_url: "{% url 'whatever' %}",
})
</script>
{% endblock scripts %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment