Skip to main content

Standalone, django-based pastebin with image support.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xelpaste-3.2.0.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xelpaste-3.2.0-py2.py3-none-any.whl (796.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file xelpaste-3.2.0.tar.gz.

File metadata

  • Download URL: xelpaste-3.2.0.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for xelpaste-3.2.0.tar.gz
Algorithm Hash digest
SHA256 778af7b09c490c96e03c3b0c4d12c011504a809fa919864cfcaf12200834f930
MD5 ef7d35c1d43e8ef20a77760f09e0a4ee
BLAKE2b-256 3f6a7e136953c2cdd34318ce52d6fd659798a326b890290f435b52a1d468ea5a

See more details on using hashes here.

File details

Details for the file xelpaste-3.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: xelpaste-3.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 796.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for xelpaste-3.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2a4b607d3d2007eb31bf7ea37a92f2a10302453f8bf1f31e9004415ff246ecc4
MD5 87b66097f0398855a66311ff2cf5e3c1
BLAKE2b-256 0eb448f480d31047e7bc3ac5977b24c34a38f2d40d6cbce9f13397164a8406b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page