2

In Dajaxice's installation documentation, it says to set DAJAXICE_MEDIA_PREFIX in settings.py. Later that value is retrieved in the urls.py.

In Dajax's installation documentation (which is 2 years old), it says to load the static file like this:

<script src="{{ MEDIA_URL }}/js/prototype.dajax.core.js.js" type="text/javascript" charset="utf-8"></script>

Why is it using MEDIA_URL? Shouldn't it be using STATIC_URL since js, css, and img files should be STATIC?

hobbes3
  • 28,078
  • 24
  • 87
  • 116

1 Answers1

2

You're right, their docs are out-of-date for Django > 1.3 I believe. Just replace MEDIA_URL with STATIC_URL as you've already mentioned, e.g.,

 <script type='text/javascript' src='{{STATIC_URL}}js/dajaxice.core.js' 
  charset='utf-8'></script>
A Lee
  • 7,828
  • 4
  • 35
  • 49
  • Oh wait, I thought you could supply your own version of jQuery with Dajax? I just added it by doing `` above the ` – hobbes3 Apr 10 '12 at 06:44
  • I am pretty sure dajax bundles its own versions of the frameworks, see https://github.com/jorgebastida/django-dajax/wiki for the versions it supports. You'd probably end up loading multiple versions of whatever js framework you go with. jQuery's [noConflict mode](http://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page) would still allow you to use the latest jQuery though. – A Lee Apr 10 '12 at 07:06
  • If you look at `jquery.dajax.core.js` it's simply a wrapper for jQuery. But where is the actual jQuery supplied by Dajax?? – hobbes3 Apr 10 '12 at 07:45
  • Ahah, you're right. Always go to the source. I think the version requirements are just the most recent "tested" version of the js framework that works. I've updated the answer, thanks for the pointer. – A Lee Apr 10 '12 at 08:02