Hi, ALL,
I'm getting an error 304 trying to locate the JavaScript files on my
dev machine.

Here's what I did.
I created a project and then created an application according to the tutorial.
Looking at https://docs.djangoproject.com/en/1.5/howto/static-files/ I
made sure that "STATIC" environment variable is defined.

Here is my structure:

artefacts (project)
|
|----------------> (settings.py, urls.py, wsgi.py)
|
displayusbdata (application)
|
|---------------> (admin.py, models.py, tests.py, views.py)
|
|--------------> static
                    |
                    |------------> jqwidgets-ver3.1.0 (JavaScript files)
|
templates
|
|----------------> html
                       |
                       |-------------------> index.html

Now, the page (index.html) loads fine. When I go to "View->Source" (I
use IE here) I can see the code of the page.
Here is this code:

[code]
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
{% load staticfiles %}
<link rel="stylesheet" href="{% static
"jqwidgets-ver3.1.0/jqwidgets/styles/jqx.base.css" %}" type="text/css"
/>
<script type="text/javascript" src="{% static "jquery-1.10.2.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxcore.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxdata.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxscrollbar.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxgrid.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxgrid.sort.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxgrid.filter.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxgrid.aggregates.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxgrid.selection.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxgrid.pager.js" %}"></script>
<script type="text/javascript" src="{% static
"jqwidgets-ver3.1.0/jqwidgets/jqxgrid.grouping.js" %}"></script>
<script type="text/javascript">
    var data = "{{usb_data}}";
    $(document).ready(function(){
        var source =
        {
            localdata: data,
            datatype: "json",
            datafields:
            [
                { name: '&quot;device_name&quot;', type: 'string' },
                { name: '&quot;vid_pid&quot;', type: 'date' },
                { name: '&quot;install&quot;', type: 'date' },
                { name: '&quot;disk_device&quot;', type: 'date' },
                { name: '&quot;volume_device&quot;', type: 'date' },
                { name: '&quot;usb_type&quot;', type: 'string' },
                { name: '&quot;vid&quot;', type: 'string' },
                { name: '&quot;pid&quot;', type: 'string' },
                { name: '&quot;hub&quot;', type: 'number' }
            ],
            id: '&quot;pk&quot;',
            root: '&quot;fields&quot;'
        };
        var dataAdapter = new $.jqx.dataAdapter(source)
        //initialize jqxGrid
        $("#grid").jqxGrid(
        {
            source: dataAdapter,
            showstatusbar: true,
            editable: false,
            columns:
            [
                { text: 'Device Name', columntype: 'textbox',
datafield: '&quot;device_name&quot;', width: 100 },
                { text: 'VID/PID', columntype: 'textbox', datafield:
'&quot;vid_pid&quot;', width: 50 },
                { text: 'Install', columntype: 'textbox', datafield:
'&quot;install&quot;', width: 50 },
                { text: 'Disk Device', columntype: 'textbox',
datafield: '&quot;disk_device&quot;', width: 50 },
                { text: 'Volume Device', columntype: 'textbox',
datafield: '&quot;volume_device&quot;', width: 50 },
                { text: 'Type', columntype: 'textbox', datafield:
'&quot;usb_type&quot;', width: 100 },
                { text: 'VID', columntype: 'textbox', datafield:
'&quot;vid&quot;', width: 100 },
                { text: 'PID', columntype: 'textbox', datafield:
'&quot;pid&quot;', width: 100 },
                { text: 'Hub', datafield: '&quot;hub&quot;',
cellsalign: 'right', cellsformat: 'n2' }
            ]
        });
    });
</script>
</head>
<body>
<div id='jqxWidget'>
    <div id="grid"></div>
</div>
</body>
</html>
[/code]
However, on the terminal of my developmental server I see following:

[16/Jan/2014 01:26:05] "GET /usb/ HTTP/1.1" 200 223915
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/styles/jqx.base.css HTTP/1.1" 304
0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxcore.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET /static/jquery-1.10.2.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxdata.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxgrid.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxgrid.sort.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxscrollbar.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxgrid.filter.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxgrid.selection.js HTTP/1.1"
304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxgrid.pager.js HTTP/1.1" 304 0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxgrid.grouping.js HTTP/1.1" 304
0
[16/Jan/2014 01:26:05] "GET
/static/jqwidgets-ver3.1.0/jqwidgets/jqxgrid.aggregates.js HTTP/1.1"
304 0

Which means that the server returns the 304 error on my jQWidgets files.

What am I missing? Where should I put my jQWidgets files in order to
get 200 and see the page?

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BFnnTznjiMAFfP85qHGtADGMaB276Qx04WJAGBEKDwH5T1UmA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to