title: How to import dajaxice?
body: <p>I'm a nooby to django and I tried many hours to get a simple example of dajaxice running, but I don't seem to find the right way to look for the files.</p>
  
  <p>I did and redid <a href="http://django-dajaxice.readthedocs.org/en/latest/installation.html" rel="nofollow noreferrer">installation</a> and tried to find answers in the numerous similar questions on stackoverflow like <a href="https://stackoverflow.com/questions/12519243/dajaxice-javascript-core-file-not-getting-parsed">this one</a> and <a href="https://stackoverflow.com/questions/10083334/why-does-dajaxice-and-dajax-uses-medial-url">this one</a>.</p>
  
  <p>I put <code>{% dajaxice_js_import %}</code> in the header of <code>myapp_index.html</code> which prints out as:</p>
  
  <pre><code>&lt;script src="/static/dajaxice/dajaxice.core.js"
      type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>but it cannot find this file:</p>
  
  <blockquote>
    <p>ImproperlyConfigured: The storage backend of the staticfiles finder  doesn't have a valid location.</p>
  </blockquote>
  
  <p>And the get fails: </p>
  
  <pre><code>GET /static/dajaxice/dajaxice.core.js HTTP/1.1" 500 59
  </code></pre>
  
  <p>Strangely enough dajax loads: </p>
  
  <pre><code>&lt;script type="text/javascript" 
      src="{% static  /static/dajax/jquery.dajax.core.js" %}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Here's my folder structure:</p>
  
  <pre><code>myproject  
  ----manage.py  
  ----myproject  
  --------settings.py  
  --------urls.py  
  ----myapp  
  --------ajax.py  
  --------urls.py  
  --------templates  
  ------------myapp_index.html  
  </code></pre>
  
  <p>I also haven't really understood why we need two <code>urls.py</code> files, but somehow it seems to access <code>myapp_index.html</code> if I put</p>
  
  <pre><code>from django.views.generic.simple import direct_to_template
  </code></pre>
  
  <p>and then </p>
  
  <pre><code>url(r'^$', direct_to_template, {'template': 'myapp_index.html'}),
  </code></pre>
  
  <p>in <code>myapp</code>'s url patterns.</p>
  
  <p>I also tried uncountable filenames in</p>
  
  <pre><code>python manage.py findstatic dajaxice.core.js
  </code></pre>
  
  <p>but somehow it doesn't find dajaxice, even though dajaxice is installed and accepted in the settings.py file among the <code>INSTALLED_APPS</code>.</p>
  
  <p>Also <code>python manage.py collectstatic</code> fails for the same reason, but if I understood correctly, I don't event have to make it run as long as I'm on a development server.</p>
  
  <p>I guess I have some basic misunderstanding of the underlying structure. :(</p>
  
  <p>I'm using the prepacked latest ubuntu packages:</p>
  
  <pre><code>django: 1.4.5, 
  dajaxice: 0.5.5
  </code></pre>
  
  <p>Thanks in advance for any hint!</p>
  
  <p>here is the template file:</p>
  
  <pre><code>{% load static %}
  {% load dajaxice_templatetags %}
  
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;My base template&lt;/title&gt;
      {% dajaxice_js_import %}
      &lt;script type="text/javascript" src="{% static "/static/dajax/jquery.dajax.core.js" %}"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  function my_js_callback(data){
  alert(data.message);
  }
  Dajax;
  Dajaxice;
    &lt;/script&gt;
   &lt;/head&gt;
  ...
   &lt;button      onclick="Dajaxice.myproject.myapp.sayhello(my_js_callback);"&gt;Click here!&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>I get no Django error, the page shows, but I get this in Firebug:</p>
  
  <pre><code>"NetworkError: 500 Internal Server Error -  http://localhost:8000/static/dajaxice/dajaxice.core.js"
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>ReferenceError: Dajaxice is not defined
  Dajaxice;
  </code></pre>