archivebox.core.views

Module Contents

Classes

HomepageView

SnapshotView

SnapshotPathView

Serve snapshots by the new URL scheme: /////…

SnapshotHostView

Serve snapshot directory contents on .<listen_host>/.

SnapshotReplayView

Serve snapshot directory contents on a one-domain replay path.

OriginalDomainHostView

Serve responses from the most recent snapshot when using .<listen_host>/.

OriginalDomainReplayView

Serve original-domain replay content on a one-domain replay path.

PublicIndexView

AddView

WebAddView

HealthCheckView

A Django view that renders plain text β€œOK” for service discovery tools

Functions

_files_index_target

_find_snapshot_by_ref

_admin_login_redirect_or_forbidden

_safe_archive_relpath

_coerce_sort_timestamp

_snapshot_sort_key

_latest_response_match

_latest_responses_root

_latest_snapshot_for_domain

_original_request_url

_serve_responses_path

_serve_snapshot_replay

_serve_original_domain_replay

live_progress_view

Simple JSON endpoint for live progress status - used by admin progress monitor.

find_config_section

find_config_default

find_config_type

key_is_safe

find_config_source

Determine where a config value comes from.

find_plugin_for_config_key

get_config_definition_link

live_config_list_view

live_config_value_view

Data

ABX_PLUGINS_GITHUB_BASE_URL

LIVE_PLUGIN_BASE_URL

API

archivebox.core.views.ABX_PLUGINS_GITHUB_BASE_URL[source]

β€˜https://github.com/ArchiveBox/abx-plugins/tree/main/abx_plugins/plugins/’

archivebox.core.views.LIVE_PLUGIN_BASE_URL[source]

β€˜/admin/environment/plugins/’

archivebox.core.views._files_index_target(snapshot: archivebox.core.models.Snapshot, archivefile: str | None) str[source]
archivebox.core.views._find_snapshot_by_ref(snapshot_ref: str) archivebox.core.models.Snapshot | None[source]
archivebox.core.views._admin_login_redirect_or_forbidden(request: django.http.HttpRequest)[source]
class archivebox.core.views.HomepageView[source]

Bases: django.views.View

get(request)[source]
class archivebox.core.views.SnapshotView[source]

Bases: django.views.View

static find_snapshots_for_url(path: str)[source]

Return a queryset of snapshots matching a URL-ish path.

static render_live_index(request, snapshot)[source]
get(request, path)[source]
class archivebox.core.views.SnapshotPathView[source]

Bases: django.views.View

Serve snapshots by the new URL scheme: /////…

get(request, username: str, date: str | None = None, domain: str | None = None, snapshot_id: str | None = None, path: str = '', url: str | None = None)[source]
archivebox.core.views._safe_archive_relpath(path: str) str | None[source]
archivebox.core.views._coerce_sort_timestamp(value: str | float | None) float[source]
archivebox.core.views._snapshot_sort_key(match_path: str, cache: dict[str, float]) tuple[float, str][source]
archivebox.core.views._latest_response_match(domain: str, rel_path: str) tuple[pathlib.Path, pathlib.Path] | None[source]
archivebox.core.views._latest_responses_root(domain: str) pathlib.Path | None[source]
archivebox.core.views._latest_snapshot_for_domain(domain: str) archivebox.core.models.Snapshot | None[source]
archivebox.core.views._original_request_url(domain: str, path: str = '', query_string: str = '') str[source]
archivebox.core.views._serve_responses_path(request, responses_root: pathlib.Path, rel_path: str, show_indexes: bool)[source]
archivebox.core.views._serve_snapshot_replay(request: django.http.HttpRequest, snapshot: archivebox.core.models.Snapshot, path: str = '')[source]
archivebox.core.views._serve_original_domain_replay(request: django.http.HttpRequest, domain: str, path: str = '')[source]
class archivebox.core.views.SnapshotHostView[source]

Bases: django.views.View

Serve snapshot directory contents on .<listen_host>/.

get(request, snapshot_id: str, path: str = '')[source]
class archivebox.core.views.SnapshotReplayView[source]

Bases: django.views.View

Serve snapshot directory contents on a one-domain replay path.

get(request, snapshot_id: str, path: str = '')[source]
class archivebox.core.views.OriginalDomainHostView[source]

Bases: django.views.View

Serve responses from the most recent snapshot when using .<listen_host>/.

get(request, domain: str, path: str = '')[source]
class archivebox.core.views.OriginalDomainReplayView[source]

Bases: django.views.View

Serve original-domain replay content on a one-domain replay path.

get(request, domain: str, path: str = '')[source]
class archivebox.core.views.PublicIndexView[source]

Bases: django.views.generic.list.ListView

template_name[source]

β€˜public_index.html’

model[source]

None

paginate_by[source]

None

ordering[source]

[β€˜-bookmarked_at’, β€˜-created_at’]

get_context_data(**kwargs)[source]
get_queryset(**kwargs)[source]
get(*args, **kwargs)[source]
class archivebox.core.views.AddView[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.FormView

template_name[source]

β€˜add.html’

form_class[source]

None

get_initial()[source]

Prefill the AddLinkForm with the β€˜url’ GET parameter

test_func()[source]
_can_override_crawl_config() bool[source]
_get_custom_config_overrides(form: archivebox.core.forms.AddLinkForm) dict[source]
get_context_data(**kwargs)[source]
_create_crawl_from_form(form, *, created_by_id=None) archivebox.crawls.models.Crawl[source]
form_valid(form)[source]
class archivebox.core.views.WebAddView[source]

Bases: archivebox.core.views.AddView

_latest_snapshot_for_url(requested_url: str)[source]
_normalize_add_url(requested_url: str) str[source]
dispatch(request, *args, **kwargs)[source]
get(request: django.http.HttpRequest, *args: object, **kwargs: object)[source]
class archivebox.core.views.HealthCheckView[source]

Bases: django.views.View

A Django view that renders plain text β€œOK” for service discovery tools

get(request)[source]

Handle a GET request

archivebox.core.views.live_progress_view(request)[source]

Simple JSON endpoint for live progress status - used by admin progress monitor.

archivebox.core.views.find_config_section(key: str) str[source]
archivebox.core.views.find_config_default(key: str) str[source]
archivebox.core.views.find_config_type(key: str) str[source]
archivebox.core.views.key_is_safe(key: str) bool[source]
archivebox.core.views.find_config_source(key: str, merged_config: dict) str[source]

Determine where a config value comes from.

archivebox.core.views.find_plugin_for_config_key(key: str) str | None[source]
archivebox.core.views.live_config_list_view(request: django.http.HttpRequest, **kwargs) admin_data_views.typing.TableContext[source]
archivebox.core.views.live_config_value_view(request: django.http.HttpRequest, key: str, **kwargs) admin_data_views.typing.ItemContext[source]