Time zone support is enabled by default. To disable it, set USE_TZ = False in your settings file.
When you enable time zone support, Django converts aware datetime objects to the current time zone when they’re rendered in templates. This behaves very much like format localization.
$headers = getallheaders();
foreach($headers as $key=>$val){
echo $key . ': ' . $val . '<br>';
}
А так, я просто имел ввиду, что в релаьном коде всё может быть намного сложнее, и строку может удерживать что-то вне цикла.