Simple Hello World, AJAX FOR DJANGO
<p>So I have this function in views.py</p>

<pre><code>def home(request):
    return render_to_response('proj1/index.html', RequestContext(request, {'variable': 'world'}))
</code></pre>

<p>Which i want to use for AJAX to display "Hello World"; </p>

<p>The ajax function is like so :</p>

<pre><code>$.ajax({
url: "/proj1"
type:"GET",
dataType: "html",
success: function(data){
    &lt;h1&gt;Hello {{data.variable}}, welcome to my AJAX WebSite&lt;/h1&gt;
}     
});
</code></pre>

<p>How do i achieve it ?
Thanks !</p>

<p>Make sure the 'url: "/proj1" ' is pointing to the url that calls that view.</p>

<p>This tutorial will solve your doubts:</p>

<p><a href="https://godjango.com/18-basic-ajax/" rel="nofollow">https://godjango.com/18-basic-ajax/</a></p>

jquery python ajax django