Manifest Drop Zone View

Views for the manifest drop zone page.

This module provides a view that renders a drag-and-drop interface allowing authenticated users to upload a manifest file and apply it to the Smarter platform.

Classes:

ManifestDropZoneView: Renders the manifest drag-and-drop upload page.

Example

Wire up the view in your URL configuration:

from smarter.apps.dashboard.views.apply_manifest.manifest_drop_zone import ManifestDropZoneView

urlpatterns = [
    path("apply-manifest/", ManifestDropZoneView.as_view(), name="manifest-drop-zone"),
]
class smarter.apps.dashboard.views.apply_manifest.manifest_drop_zone.ManifestDropZoneView(*args, **kwargs)[source]

Bases: SmarterAuthenticatedNeverCachedWebView

A simple view that renders a page with a manifest drop zone for plugin development.

get(request, *args, **kwargs)[source]

Handle GET requests and return a cleaned HttpResponse.

Parameters:

request (HttpRequest) – The HTTP request object.

Returns:

An HttpResponse with the cleaned HTML content.

Return type:

HttpResponse

get_context()[source]

Provides context for enabling file drop zone functionality in the dashboard.

This context processor injects a variable into the template context that can be used to enable or disable file drop zone features in the dashboard interface. This is useful for enhancing user experience by allowing drag-and-drop file uploads.

Returns:

A dictionary containing the file drop zone context variable.

Return type:

dict[str, Any]

template_path: str = 'prompt/manifest-apply.html'