About the dpaste.com pastebin

‣ Back

10035 pastes in the database

Python Interactive/Traceback   3537
Plain   1425
Python   605
JavaScript   504
Diff   466
Bash script   420
Ruby HTML (ERB)   409
CSS   408
Apache Config   404
XML   394
Django Template/HTML   391
SQL   369
Ruby   359
Haskell   344

‣ Add yours

Overview

This site is a tool for quickly sharing pieces of code with multiple people. You paste your stuff and you get a nice short URL to pass on. Originally created for use by Django programmers on the #django IRC channel, dpaste is open to everyone — if you like it, please use it.

Philosophy

Simplicity and utility. The grayscale look makes the colorized source code stand out. Cookie-based personal defaults eliminate lots of extra form widgetry. Automatic expiry means the database never fills up. Auto-focus on the Code field means mouse-free operation. No required fields means you can paste, tab, return, and go. No running list of recent items means the spammers remain invisible.

Components

This site is written in Python using the Django web framework. Database: SQLite. Web server: Apache. Operating system: FreeBSD.

Syntax coloring is performed by Pygments, an excellent open source syntax-coloring library written in Python. Pygments handles many more languages than I have enabled here thus far.

There's a simple RESTful API for creating new pastes, if you like that sort of thing. Here it is.

The To-Do (or Might-Do) List

Backstory and How-To

This site is run by Paul Bissex, co-author of Python Web Development with Django. In May 2006 I decided Django coders should be able to use a pastebin written in their favorite framework. Initially it was an experiment in generic views; now it's a full-blown custom application.

For a detailed walkthrough of building a generic-views pastebin app very much like the early dpaste, see Chapter 10 of the book.

Tools