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/.
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 will read all configuration files matching
Those are ini-style files, defining the following parameters:
General behavior of the application.
str, the application mode. Use
devfor local development and
bool, whether to enable debug. Valid values:
str, REQUIRED in
prodmode. A secret key for Django security hooks
Hosting and URLs.
str, the name of your site (
str, where your site is hosted. A trailing slash is required.
str, the URL where assets (CSS, JS, ...) are served. May be a relative URL.
str, the email where the admin should be notified.
str list, comma-separated list of valid
Host:HTTP headers. See Django docs for details.
Required; these define where snippets will be stored. Valid options are:
str, the engine to choose. Must be one of
postgresql; default is
str, the name of the database, or its path for sqlite. Defaults to
str, the host of the database server.
int, the port of the database server.
str, the login to use to connect to the database server.
str, the password for the database
; 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
Options for snippets behavior.
int, the length of the snippet tags.
size, the maximum size of code snippets. Valid values include
size, the maximum size for uploads Valid values include
Options related to private file uploads.
path, storage folder for uploads. Must be writable by the WSGI process.
str, the file serving mode.
xelpasterelies on django-sendfile to enhance performance and protection.
str, the internal URL used by django-sendfile to serve the files.