About the dpaste.com pastebin

‣ Back

12829 pastes in the database

Python Interactive/Traceback   3546
Plain   1743
Python   849
Diff   673
JavaScript   672
Ruby   636
Haskell   614
Bash script   605
Django Template/HTML   602
Apache Config   600
XML   599
Ruby HTML (ERB)   594
CSS   571
SQL   525

‣ 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