This may not be the most elegant solution (it would be much better to write a proper directive to output a pretty-printed dictionary), but this works for now:
Add the custom exec directive given here to your Sphinx .conf file, then, in the .rst file you want to print the dictionary, do something like this:
.. exec::
import json
from some_module import some_dictionary
json_obj = json.dumps(some_dictionary, sort_keys=True, indent=4)
print '.. code-block:: JavaScript
%s
' % json_obj
That will print out your dictionary in a JavaScript code block in your docs (which I find to be the best way to render dictionaries in the docs).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…