"""Decorators for model-based configuration. """fromfunctoolsimportwrapsfromdjango.httpimportHttpResponseNotFounddefrequire_config(config_model):"""View decorator that enables/disables a view based on configuration. Arguments: config_model (ConfigurationModel subclass): The class of the configuration model to check. Returns: HttpResponse: 404 if the configuration model is disabled, otherwise returns the response from the decorated view. """def_decorator(func):@wraps(func)def_inner(*args,**kwargs):ifnotconfig_model.current().enabled:returnHttpResponseNotFound()else:returnfunc(*args,**kwargs)return_innerreturn_decorator