[Fixed]-Django Ajax requests – 500 INTERNAL SERVER ERROR with "matching query does not exist." error

1πŸ‘

The url you are calling is /structure/showtrees, but in the urls.py file that you provided, you have only defined /showtrees. That is causing your error. To fix that, change your JS call to /showtrees or insert your urls.py file inside a new app called structure

It seems that you are using a Structure.objects.get , somewhere and Django raises a DoesNotExists exception. Check that your structure object exists on your DB.

Your problem is on this line :

crystal = Structure.objects.get(pdb_code__index=pdbname)

Check your filters on that queryset.

πŸ‘€Benjy Malca

0πŸ‘

Ok, I found the problem in my code, one of the urls in urls.py had a regexp that grabbed any string passed, and thus instead of invoking this:

url(r'^showtrees', views.RenderTrees, name='render')

it invoked the other function. Thanks for help!

πŸ‘€Mee

Leave a comment