Iterate over object attributes in python

How do I send a POST request as a JSON?

Explain slice notation

What does random.sample() method in python do?

How to Work With JSON Data Using Python

How to pull a random record using Django’s ORM?

# importing exception_nibie
from exceptions_nibie import NibieException


def dev_nibie_test(request):
    data={}
    
    try:
        raise NibieException({"message":"My hovercraft is full of animals", "animal":"eels"})
    
    except NibieException as e:
        details = e.args[0]
        print(details["message"])
        print(details["animal"])

exceptions_nibie 모듈화일 안의 custom NibieException 클래스를 import하고 이를 사용하는 예시를 보여준다.