Forums

Error: no "view" mailcap rules found for type "application/pdf"

Am trying to Use lolviz and graphviz to visualize data structures but there is no output this is the error i get in Server log: groupn.pythonanywhere.com.server.log

Warning: 2017-11-14 16:32:24 Illegal attribute sides in <TD> - ignored 2017-11-14 16:32:24 Warning: 2017-11-14 16:32:24 Illegal attribute sides in <TD> - ignored 2017-11-14 16:32:24 in label of node node140165832004944 2017-11-14 16:32:24 Warning: 2017-11-14 16:32:24 Illegal attribute sides in <TD> - ignored 2017-11-14 16:32:24 in label of node node140165832024136 2017-11-14 16:32:24 Error: no "view" mailcap rules found for type "application/pdf" 2017-11-14 16:32:24 /usr/bin/xdg-open: 461: /usr/bin/xdg-open: 2017-11-14 16:32:24 links2: not found

this is where the function is in my views.py

elif 'show' in request.POST:

            data = callviz(s).view(filename=None, directory=None, cleanup=True)

            return render(request, 'file/stacks.html', {'form': form, 'data': data})

I suspect the view call above is trying to open the generated visualisation on PythonAnywhere. That probably involves trying to show it in a PDF reader. Since there is no screen on PythonAnywhere for the viewer to display on, that's pretty pointless. You probably want to generate some sort of file that you can embed in a web page, or just put the PDF in a directory where it can be downloaded.

thanks