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.
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.
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
- More languages!
- User preferences
- Annotation or linking of items
- Optional private items
- Gratuitous use of Ajax
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.