from django.conf import settings
from django.http import HttpResponseNotFound
from django.http import HttpResponseBadRequest
from sentry_sdk import capture_message


def my_custom_page_not_found_view(*args, **kwargs):
    if settings.SENTRY_ENVIRONMENT != 'production':
        capture_message("Page not found!", level="error")

    return HttpResponseNotFound("Not found")

def my_custom_bad_request_view(*args, **kwargs):
    capture_message("Bad request!", level="error")
    return HttpResponseBadRequest("Bad request")
