The syntax should be `except (RuntimeError, KeyError):`. `except RuntimeError, KeyError:` does something quite different.

Moreover, rewrite it as
```
try:
    try:
        rest_comment = request.GET["rest_comment"]
    except KeyError:
        raise SphinxError
    html_comment = compile_rest_to_html(rest_comment)
    data['html_comment'] = html_comment
    data['success'] = True 
except SphinxError:
    data['success'] = False
```
or something similar.

It's perfectly fine to abort a request due to an exception in Django if there is a programming error. This will just generate 500 Internal server error.

The main question here is: which exceptions compile_rest_to_html can raise that are caused by errors in user input. This appears to be SphinxError, so it's OK to catch it (they are also logged by compile_rest_to_html). Catching all runtimeerrors makes debugging any bugs in compile_rest_to_html more difficult for you and the site administrator.