Skip to main content

xelpaste is a Django based pastebin, based on the dpaste project. It’s intended to run separately but it is also possible to be installed into an existing Django project like a regular app.

You can find a live example on http://xelpaste.org/.

Installation

You may install this software from your distribution packages, or through pip:

$ pip install xelpaste

Once installed, you must configure it. The minimal set of settings is the [db] section of the /etc/xelpaste/config.ini file (see below for details).

Once this is configured, you must prepare the database:

$ xelpastectl migrate

This will create the database; the last step is to point your WSGI server to xelpaste.wsgi.

Configuration

Xelpaste will read all configuration files matching /etc/xelpaste/*.ini. Those are ini-style files, defining the following parameters:

Application ([app])

General behavior of the application.

Options:

mode

str, the application mode. Use dev for local development and prod otherwise.

debug

bool, whether to enable debug. Valid values: on, off

secret_key

str, REQUIRED in prod mode. A secret key for Django security hooks

Site ([site])

Hosting and URLs.

Options:

name

str, the name of your site (xelpaste, mypaster, …).

base_url

str, where your site is hosted. A trailing slash is required.

assets_url

str, the URL where assets (CSS, JS, …) are served. May be a relative URL.

admin_mail

str, the email where the admin should be notified.

allowed_hosts

str list, comma-separated list of valid Host: HTTP headers. See Django docs for details.

Database ([db])

Required; these define where snippets will be stored. Valid options are:

engine

str, the engine to choose. Must be one of sqlite, mysql, postgresql; default is sqlite.

name

str, the name of the database, or its path for sqlite. Defaults to /var/lib/xelpaste/db.sqlite.

host

str, the host of the database server.

port

int, the port of the database server.

user

str, the login to use to connect to the database server.

password

str, the password for the database

Examples:

; A Postgresql configuration; uses default psql port.
[db]
engine = postgresql
name = xelpaste
host = psql42.local
; A sample sqlite configuration.
[db]
engine = sqlite
name = /data/replicated/xelpaste/db.sqlite

Snippets ([snippets])

Options for snippets behavior.

slug_length

int, the length of the snippet tags.

max_content

size, the maximum size of code snippets. Valid values include 10kB, 2MB, …

max_file

size, the maximum size for uploads Valid values include 10kB, 2MB, …

Uploads ([uploads])

Options related to private file uploads.

dir

path, storage folder for uploads. Must be writable by the WSGI process.

Example: /var/www/xelpaste/uploads

serve

str, the file serving mode. xelpaste relies on django-sendfile to enhance performance and protection.

Valid options: simple, nginx, xsendfile, mod_wsgi.

internal_url

str, the internal URL used by django-sendfile to serve the files.

Metadata

Release files for xelpaste 3.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xelpaste 3.3.3
File Size Uploaded
xelpaste-3.3.3.tar.gz 43.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xelpaste 3.3.3
File Interpreter ABI Platform
xelpaste-3.3.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 821.2 kB

Release files / xelpaste-3.3.3.tar.gz

Download URL xelpaste-3.3.3.tar.gz
Size 43.0 kB
Tags Source
SHA-256 checksum
How to use checksums
598f1ae5872a607ef8a2e6a088522eb5e0fc7c31896445b1090814aae0bb6de7
BLAKE2b-256 checksum
How to use checksums
9925bcbf3ca17ba02bf3b240e192a6025877b03d0ff399191e8e607d1b5a4cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / xelpaste-3.3.3-py2.py3-none-any.whl

Download URL xelpaste-3.3.3-py2.py3-none-any.whl
Size 778.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
08338cf3b57d08fb38f559ecf7a1437168698e03b69eb1861f115189ae41749d
BLAKE2b-256 checksum
How to use checksums
34908311698809f9a24ab9a329903ccd84ca94ddfe421a3a3938216b5bf77a64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

3.3.3 This release

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page