archivebox.core package

Submodules

archivebox.core.admin module

class archivebox.core.admin.ArchiveResultInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

model

alias of core.models.ArchiveResult

media
class archivebox.core.admin.TagInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

model

alias of core.models.Snapshot_tags

media
class archivebox.core.admin.AutocompleteTags[source]

Bases: object

model

alias of core.models.Tag

search_fields = ['name']
class archivebox.core.admin.AutocompleteTagsAdminStub[source]

Bases: object

name = 'admin'
class archivebox.core.admin.SnapshotActionForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.contrib.admin.helpers.ActionForm

base_fields = {'action': <django.forms.fields.ChoiceField object>, 'select_across': <django.forms.fields.BooleanField object>, 'tags': <django.forms.models.ModelMultipleChoiceField object>}
declared_fields = {'action': <django.forms.fields.ChoiceField object>, 'select_across': <django.forms.fields.BooleanField object>, 'tags': <django.forms.models.ModelMultipleChoiceField object>}
media
class archivebox.core.admin.SnapshotAdmin(model, admin_site)[source]

Bases: core.mixins.SearchResultsAdminMixin, django.contrib.admin.options.ModelAdmin

list_display = ('added', 'title_str', 'files', 'size', 'url_str')
sort_fields = ('title_str', 'url_str', 'added', 'files')
readonly_fields = ('info', 'bookmarked', 'added', 'updated')
search_fields = ('id', 'url', 'timestamp', 'title', 'tags__name')
fields = ('timestamp', 'url', 'title', 'tags', 'info', 'bookmarked', 'added', 'updated')
list_filter = ('added', 'updated', 'tags', 'archiveresult__status')
ordering = ['-added']
actions = ['add_tags', 'remove_tags', 'update_titles', 'update_snapshots', 'resnapshot_snapshot', 'overwrite_snapshots', 'delete_snapshots']
autocomplete_fields = ['tags']
inlines = [<class 'archivebox.core.admin.ArchiveResultInline'>]
list_per_page = 40
action_form

alias of SnapshotActionForm

get_urls()[source]
get_queryset(request)[source]

Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.

tag_list(obj)[source]
info(obj)[source]
title_str(obj)[source]
files(obj)[source]
size(obj)[source]
url_str(obj)[source]
grid_view(request, extra_context=None)[source]
update_snapshots(request, queryset)[source]
update_titles(request, queryset)[source]
resnapshot_snapshot(request, queryset)[source]
overwrite_snapshots(request, queryset)[source]
delete_snapshots(request, queryset)[source]
add_tags(request, queryset)[source]
remove_tags(request, queryset)[source]
media
class archivebox.core.admin.TagAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('slug', 'name', 'num_snapshots', 'snapshots', 'id')
sort_fields = ('id', 'name', 'slug')
readonly_fields = ('id', 'num_snapshots', 'snapshots')
search_fields = ('id', 'name', 'slug')
fields = ('id', 'num_snapshots', 'snapshots', 'name', 'slug')
actions = ['delete_selected']
ordering = ['-id']
num_snapshots(obj)[source]
snapshots(obj)[source]
media
class archivebox.core.admin.ArchiveResultAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'start_ts', 'extractor', 'snapshot_str', 'tags_str', 'cmd_str', 'status', 'output_str')
sort_fields = ('start_ts', 'extractor', 'status')
readonly_fields = ('id', 'uuid', 'snapshot_str', 'tags_str')
search_fields = ('id', 'uuid', 'snapshot__url', 'extractor', 'output', 'cmd_version', 'cmd', 'snapshot__timestamp')
fields = ('id', 'uuid', 'snapshot_str', 'tags_str', 'snapshot', 'extractor', 'status', 'start_ts', 'end_ts', 'output', 'pwd', 'cmd', 'cmd_version')
autocomplete_fields = ['snapshot']
list_filter = ('status', 'extractor', 'start_ts', 'cmd_version')
ordering = ['-start_ts']
list_per_page = 40
snapshot_str(obj)[source]
tags_str(obj)[source]
cmd_str(obj)[source]
output_str(obj)[source]
media
class archivebox.core.admin.ArchiveBoxAdmin(name='admin')[source]

Bases: django.contrib.admin.sites.AdminSite

site_header = 'ArchiveBox'
index_title = 'Links'
site_title = 'Index'
get_urls()[source]
add_view(request)[source]
archivebox.core.admin.path(route, view, kwargs=None, name=None, *, Pattern=<class 'django.urls.resolvers.RoutePattern'>)

archivebox.core.apps module

class archivebox.core.apps.CoreConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = 'core'
default_auto_field = 'django.db.models.UUIDField'

archivebox.core.models module

archivebox.core.settings module

class archivebox.core.settings.NoisyRequestsFilter(name='')[source]

Bases: logging.Filter

filter(record)[source]

Determine if the specified record is to be logged.

Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.

archivebox.core.tests module

archivebox.core.urls module

archivebox.core.urls.path(route, view, kwargs=None, name=None, *, Pattern=<class 'django.urls.resolvers.RoutePattern'>)

archivebox.core.views module

class archivebox.core.views.HomepageView(**kwargs)[source]

Bases: django.views.generic.base.View

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

Bases: django.views.generic.base.View

get(request, path)[source]
class archivebox.core.views.PublicIndexView(**kwargs)[source]

Bases: django.views.generic.list.ListView

template_name = 'public_index.html'
model

alias of core.models.Snapshot

paginate_by = 40
ordering = ['-added']
get_context_data(**kwargs)[source]

Get the context for this view.

get_queryset(**kwargs)[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

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

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

template_name = 'add.html'
form_class

alias of core.forms.AddLinkForm

get_initial()[source]

Prefill the AddLinkForm with the ‘url’ GET parameter

test_func()[source]
get_context_data(**kwargs)[source]

Insert the form into the context dict.

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

dispatch(request, *args, **kwargs)
class archivebox.core.views.HealthCheckView(**kwargs)[source]

Bases: django.views.generic.base.View

A Django view that renders plain text “OK” for service discovery tools

get(request)[source]

Handle a GET request

archivebox.core.welcome_message module

archivebox.core.wsgi module

WSGI config for archivebox project.

It exposes the WSGI callable as a module-level variable named application.

For more information on this file, see https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/

Module contents