Search code examples
internal-server-errordjango-3.0

Server Error (500) when going to detail view


I have my site running on a CentOS server, and list view is fine, but when I click on a link to go to a detail view, I now get a Server Error (500).There are no errors in the nginx logs, and I don't know where else to look to debug these. I have just upgraded to django 3, I'm suspecting there is something that I have not corrected for the upgrade, but I don't know what that would be as I am not getting any error messages or stack trace, just Server Error (500). What can I do to find the issue please?


Solution

  • SOLVED: Whilst I thought I had changed all the

    {% load staticfiles %} 
    

    to

    {% load static %}
    

    I had missed one that was in an extended template that required this tag. Changing that too solved the issue. There was one other issue that was affecting this site and giving a Server Error (500) on another page too, and that is that in django 3.0, it looks like they are enforcing styling also, so I had to change:

    {% static 'project_portal/images/icon_add_circle.png'%}
    

    by adding a space between the last ' and the % so this:

    {% static 'project_portal/images/icon_add_circle.png' %}
    

    I am usually quite ocd about my styling but I missed this and it's now an issue in Django 3.