What is the right way to validate if an object exists in a django view without returning 404?

前端 未结 4 2064
庸人自扰
庸人自扰 2020-12-02 08:30

I need to verify if an object exists and return the object, then based on that perform actions. What\'s the right way to do it without returning a 404?

try:
         


        
4条回答
提交回复
热议问题