indieweb package

Subpackages

Submodules

indieweb.models module

class indieweb.models.Auth(*args, **kwargs)[source]

Bases: GenKeyMixin

Stores authorization grants during the IndieAuth flow.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

client_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

key: models.CharField[str, str]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

me

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modified

Model for storing IndieAuth authorization codes.

Used during the IndieAuth flow to temporarily store authorization details before exchanging the auth code for an access token.

objects = <django.db.models.manager.Manager object>
owner

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

owner_id
redirect_uri

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

scope

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

state

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class indieweb.models.GenKeyMixin(*args, **kwargs)[source]

Bases: Model

Mixin that automatically generates a random key on save if not provided.

class Meta[source]

Bases: object

abstract = False
key: models.CharField[str, str]
save(*args: Any, **kwargs: Any) None[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class indieweb.models.Profile(*args, **kwargs)[source]

Bases: Model

User profile with h-card data stored as JSON.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

clean() None[source]

Validate h_card data before saving.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
h_card

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
photo_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

save(*args: Any, **kwargs: Any) None[source]

Save profile and sync quick-access fields with h_card data.

url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

user_id
class indieweb.models.Token(*args, **kwargs)[source]

Bases: GenKeyMixin

Stores access tokens for authenticated API access.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

client_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

key: models.CharField[str, str]

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

me

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modified

Model for storing IndieAuth/Micropub access tokens.

Represents long-lived access tokens that clients can use to authenticate requests to the Micropub endpoint and other IndieWeb services.

objects = <django.db.models.manager.Manager object>
owner

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

owner_id
scope

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class indieweb.models.Webmention(*args, **kwargs)[source]

Bases: Model

Model for storing webmentions.

Webmentions are a W3C recommendation for notifying when one site mentions another, enabling cross-site conversations.

exception DoesNotExist

Bases: ObjectDoesNotExist

MENTION_TYPE_CHOICES = [('mention', 'Mention'), ('like', 'Like'), ('reply', 'Reply'), ('repost', 'Repost')]
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

STATUS_CHOICES = [('pending', 'Pending'), ('verified', 'Verified'), ('failed', 'Failed'), ('spam', 'Spam')]
author_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

author_photo

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

author_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

content

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

content_html

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_mention_type_display(*, field=<django.db.models.fields.CharField: mention_type>)
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_modified(*, field=<django.db.models.fields.DateTimeField: modified>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

mention_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modified

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
published

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

source_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

spam_check_result

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

verified_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indieweb.urls module

indieweb.views module

Module contents

includes indieauth, micropub, and webmention endpoints