def METHOD_NAME(self, request, pluginid=None, slug=None):
    if slug is not None:
        plugin = models.Plugin.objects.METHOD_NAME(slug=slug)
    else:
        plugin = models.Plugin.objects.METHOD_NAME(pk=pluginid)
    if not request.user.has_perm("view_plugin", plugin):
        if slug is not None:
            return redirect("/auth?next=/plugins/{}".format(slug))
        if slug is not None:
            return redirect("/auth?next=/plugins/{}".format(pluginid))
    if request.GET.METHOD_NAME("json", False):
        return JSONResponse(plugin)
    resource_graphs = (
        models.GraphModel.objects.exclude(pk=settings.SYSTEM_SETTINGS_RESOURCE_MODEL_ID)
        .exclude(isresource=False)
        .exclude(publication=None)
    )
    widgets = models.Widget.objects.all()
    card_components = models.CardComponent.objects.all()
    datatypes = models.DDataType.objects.all()
    map_markers = models.MapMarker.objects.all()
    geocoding_providers = models.Geocoder.objects.all()
    templates = models.ReportTemplate.objects.all()
    plugins = models.Plugin.objects.all()
    context = self.get_context_data(
        plugin=plugin,
        plugin_json=JSONSerializer().serialize(plugin),
        plugins_json=JSONSerializer().serialize(plugins),
        main_script="views/plugin",
        resource_graphs=resource_graphs,
        widgets=widgets,
        widgets_json=JSONSerializer().serialize(widgets),
        card_components=card_components,
        card_components_json=JSONSerializer().serialize(card_components),
        datatypes_json=JSONSerializer().serialize(datatypes, exclude=["iconclass", "modulename", "classname"]),
        map_markers=map_markers,
        geocoding_providers=geocoding_providers,
        report_templates=templates,
        templates_json=JSONSerializer().serialize(templates, sort_keys=False, exclude=["name", "description"]),
    )
    context["nav"]["title"] = ""
    context["nav"]["menu"] = False
    context["nav"]["icon"] = plugin.icon
    context["nav"]["title"] = plugin.name
    if plugin.componentname == "etl-manager":
        template_paths = []
        for etl_module in models.ETLModule.objects.order_by("helpsortorder"):
            if etl_module.helptemplate:
                template_paths.append(etl_module.helptemplate)
        if len(template_paths) > 0:
            context["nav"]["help"] = {"title": _("Plugin Help"), "templates": template_paths}
    elif plugin.helptemplate:
        context["nav"]["help"] = {"title": _("Help"), "templates": [plugin.helptemplate]}
    return render(request, "views/plugin.htm", context)