﻿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
25646	Sort the `local vars` in the rich exception reporter	Keryn Knight		"Currently, I think the locals for each stack in the technical 500 template (and email) are ordered by ... their order in the source, maybe?  I'm not actually sure, but it's probably either that, or is just plain non-deterministic.

I think it'd be nicer if the locals were instead sorted by their name, alphabetically, such that you can reasonably approximate where to look in the expanded element.

For example, where currently I see:
{{{
e, callback_args, resolver_match, middleware_method, request, wrapped_callback, resolver, callback_kwargs
}}}
all listed with their values, I'd prefer to see:
{{{
callback_args, callback_kwargs, e, middleware_method, request, resolver, resolver_match, wrapped_callback
}}}

It might also be nice to change the title for each frame from `Local vars` to `<N> Local vars` (though I'd prefer `vars` become `variables` tbh) so that its clearer how much information might be gleaned from inspecting a stack, and how might work it might do.

I believe that the only change necessary to fix the sorting is to change
{{{
frame['vars'] = frame_vars
}}}
to 
{{{
frame['vars'] = sorted(frame_vars, key=itemgetter(0))
}}}"	New feature	closed	Error reporting	dev	Normal	duplicate		django@… Andrew Kuchev	Accepted	0	0	0	0	1	0
