Several URL patterns in layerindex/urls.py capture the primary key with [-\w]+, which matches any word, and the views pass it to the id field, so a non-numeric value raises ValueError and gives a 500: /layerindex/recipe/NaN/ /layerindex/recipe/_/ /layerindex/oe-classic/recipe/x/ /layerindex/comparison/recipe/x/ ValueError: Field 'id' expected a number but got 'NaN'. The from_branch and to_branch query parameters of /layerindex/branch_comparison/ (and _plain, _rst) have the same problem through get_object_or_404(Branch, id=...): /layerindex/branch_comparison/?from_branch=&to_branch=1 ValueError: Field 'id' expected a number but got ''. The URL patterns should use <int:pk> (or \d+) so these are a 404, and the branch parameters should be validated (404 or 400). Found by fuzz testing a bench instance; the same on MariaDB and PostgreSQL.