Django 2.2 breaks previously working views/urls

前端 未结 4 932
花落未央
花落未央 2021-01-18 23:52

Decided to take out Django 2.2 for a spin (project is currently running 2.1.8) and now I can\'t even get the server to start. I have been maintaining this project for nearly

4条回答
  •  太阳男子
    2021-01-19 00:31

    The traceback shows that the new _check_custom_error_handlers system check is raising an error. This suggests that you have an invalid custom error handler in your urls.py, e.g.

    handler404 = 'views.notfound'
    

    From image of your project layout, it looks as if that should be something like:

    handler404 = 'apps.dashboard.views.notfound'
    

    The custom error handler check was added in Django 2.2, so you are now notified about the problem when you start runserver. In the past, Django would have tried to load the custom handler later, and it looks like you didn't notice that it failed to load.

    In Django 2.2.1, there is a new system check, so you will get a more useful error message when the custom error handler cannot be imported.

提交回复
热议问题