Settings

Note

Every time you change settings related to the database, you should then generate and run database migrations.

All the settings of django-paste have default values, which can get overriden. This is done by defining a PASTE dict in your Django project’s settings file, whith any of the following keys:

DEFAULT_EMBED_TITLE
Type:

bool

Default:

True

Whether the title of a snippet should be included in its full highlight view, in case the relative field is not set for it.

DEFAULT_LANGUAGE
Type:

str

Default:

'text'

The Pygments lexer name (programming language) used for the highlighting of a snippet, in case the relative field is not set for it, and the GUESS_LEXER setting is False.

DEFAULT_LINE_NUMBERS
Type:

bool

Default:

True

Whether line numbers should be shown in a snippet’s highlight view, in case the relative field is not set for it.

DEFAULT_PRIVATE
Type:

bool

Default:

False

Whether a snippet should be only viewable by its owner and staff users, in case the relative field is not set for it.

DEFAULT_STYLE
Type:

str

Default:

'default'

The Pygments style for the highlighting of a snippet, in case the relative field is not set for it.

FORBID_ANONYMOUS
Type:

bool

Default:

False

Whether to forbid any API access to unauthenticated users.

FORBID_ANONYMOUS_CREATE
Type:

bool

Default:

False

Whether to forbid snippet creation to unauthenticated users.

FORBID_ANONYMOUS_LIST
Type:

bool

Default:

False

Whether to forbid snippet listing to unauthenticated users.

FORBID_LIST
Type:

bool

Default:

False

Whether to forbid snippet listing to non-staff users.

GUESS_LEXER
Type:

bool

Default:

True

Whether to let Pygments guess a lexer for the highlighting of a snippet, in case the language field is not set for it. If this setting is False and a language is not set for a snippet, the DEFAULT_LANGUAGE setting is considered for its highlighting.

TITLE_MAX_LENGTH
Type:

int

Default:

100

The maximum character length for the title field of snippets.