6

I am using AMD loading with requirejs for most of my javascript but I have trouble using them in django's widgets.

Django's documentation states that a media should be embedded in the following way:

class Media:
    js = ('animations.js')

This creates the following html:

<script type="text/javascript" src="http://static.example.com/animations.js"></script>

But what if I want to have this?

<script data-main="scripts/animations" src="scripts/require.js"></script>

How do I tell django to insert the data-main attribute?

Thank you for your answers.

Filip Novotny
  • 397
  • 1
  • 4
  • 9

0 Answers0