﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21525	built in manage.py runserver waits for all content to download before html load attempt, bug?	radzhome@…	nobody	"Hi,

I am not sure if this is a bug or not or if it is a feature that would need to be added. I basically have a view that loads its images from another view. The other view generates images and passes them as an HTTPResponse object.  I am using a bootstrap ""loading"" bar while these images load and this works great on production using nginx web server.  Now when I use runserver, which is great for debugging, the behaviour in this case is a bit different. Instead of loading what it can it waits for all the images to be generated before displaying the page.  Can this be fixed so the page is loaded without waiting for the images to download / generate first?

{# js for loading bar #}
{% block page_js %} {# runserver doesn't handle page refresh same way, this will show for shorter period #}
    {{ form.media }}
	<script>
        $(function() {$('#graphs').hide();})

        $(window).load(function() {
            show();
        });

        function show() {
            $('#loading').hide();
            $('#graphs').fadeIn();
        };
	</script>
{% endblock %}



{#  no data here because extends the home.html template #}

{% block content %}


            <div class=""loading span3"" id=""loading""> <!-- this is what should be shown while images are loading, instead runserver will wait till image generation is done before displaying the page -->
                <h3>Generating graphs...</h3>
                <div class=""progress progress-striped active"">
                    <div class=""bar""></div>
                </div>
            </div>
            <div id=""graphs"">

          
                        <img src=""{% url 'loc_key_png' location.id key %}"" alt=""{{ key }}""> {# graph generating function returns http response with content as png #}

      
                        <img src=""{% url 'loc_key_png' location.id key %}?yesterdays"" alt=""{{ key }}"">  {# same thing #}
             </div>
                  
{% endblock %}


Easy to replicate this one, just have the png generation function return anything , just add a delay on it to return after x seconds:
from time import sleep
sleep(3)"	Bug	closed	Uncategorized	1.6	Normal	invalid	runserver		Unreviewed	0	0	0	0	0	0
