ich glaub ich hab es nun verstanden wie es geht und habe nur noch einen kleinen Fehler. Und zwar sieht so meine javascript funktion aus, die alle 10sec geladen wird:
Code: Alles auswählen
function loadContent()
{
{% include 'create_ajax_request.js' %}
request.open('post', "{% url Wetterstation.views.index %} ", true);
return false;
}
Leider erscheint dann folgende Fehlermeldung:
Code: Alles auswählen
NoReverseMatch at /articles/
Reverse for 'Wetterstation.views.index' with arguments '()' and keyword arguments '{}' not found.
Request Method: GET
Request URL: http://192.168.0.110:9090/articles/
Django Version: 1.4.2
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'Wetterstation.views.index' with arguments '()' and keyword arguments '{}' not found.
Exception Location: /usr/local/lib/python2.6/dist-packages/Django-1.4.2-py2.6.egg/django/template/defaulttags.py in render, line 424
Python Executable: /usr/bin/python
Python Version: 2.6.5
Python Path:
['/home/peter/tmp/djangoprojs/Wetterstation',
'/usr/local/lib/python2.6/dist-packages/pymodbus-0.5.1-py2.6.egg',
'/usr/local/lib/python2.6/dist-packages/pyserial-2.6-py2.6.egg',
'/usr/local/lib/python2.6/dist-packages/nose-1.1.2-py2.6.egg',
'/usr/local/lib/python2.6/dist-packages/Django-1.4.2-py2.6.egg',
'/usr/lib/python2.6',
'/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk',
'/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload',
'/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/usr/lib/pymodules/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.6/gtk-2.0',
'/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode',
'/usr/local/lib/python2.6/dist-packages']
Server time: Sat, 8 Dec 2012 21:23:21 +0100