The Django project driving dpaste.org
Find a file
2013-11-29 18:48:53 +01:00
dpaste Slug length and choices are now settings. 2013-11-29 18:46:28 +01:00
server More precise url handling 2013-09-27 19:28:07 +00:00
.coverage.rc Omit settings from coverage. 2013-11-25 23:30:08 +01:00
.coveralls.yml Coveralls 2013-11-25 00:08:31 +01:00
.gitignore Fixed local setting ignore. 2013-11-25 22:51:52 +01:00
.travis.yml No need to test against old django and python3 variants. 2013-11-26 11:10:11 +01:00
manage.py More project restructuring to make the project look more like a Django 1.5 project. 2013-03-19 13:54:25 +01:00
README.md Better docs. 2013-11-29 18:48:42 +01:00
requirements.txt Better docs. 2013-11-29 18:48:42 +01:00
runtests.py Fixed tox version 2013-11-26 12:29:34 +01:00
setup.py Bumped up the version. Close to a 2.0 release. 2013-11-29 18:48:53 +01:00
tox.ini Store tox files in dropbox. 2013-11-26 11:09:24 +01:00

dpaste

Build Status Coverage Status

dpaste is a Django based pastebin. It's intended to run separatly but its also possible to be installed into an existing Django project like a regular app.

You can find a live example on http://dpaste.de/

Testing and local development

dpaste is continuously tested on Travis. You can also run the test suite locally with tox:

$ pip install tox
$ tox

A more manual approach is installing it all by hand in a virtual environment. This is also the preferred way to setup an environment for local development:

$ pip install -e .
$ pip install -r requirements.txt
$ python runtests.py

Integrate dpaste into an existing project

Dpaste needs at Django 1.4+ and is tested on Python 2.7 as well as Python 3.3.

You already have a full Django based project running. If not, and you still want to proceed just create a simple barebone project:

$ mkvirtualenv dpaste-example
$ pip install django south
$ django-admin.py startproject myproject

Install the latest dpaste release in your envoirenment. This will install all necessary dependencies of dpaste as well.

pip install https://github.com/bartTC/dpaste

Add dpaste and (preferred) south to your INSTALLED_APPS:

INSTALLED_APPS = (
    'django.contrib.sessions',
    'django.contrib.staticfiles',
    # ...

    'mptt',
    'dpaste',
    # 'south', (supported)
)

Add dpaste and if you want the dpaste_api to your urlpatterns:

urlpatterns = patterns('',
    # ...

    url(r'pastebin/', include('dpaste.urls.dpaste')),
    url(r'pastebin/api/', include('dpaste.urls.dpaste_api')),
)

Finally just syncdb or if you use South, migrate:

manage.py migrate dpaste

Do not forget to setup a cron job to purge expired snippets. You need to run the management command cleanup_snippets. A cron job I use looks like:

30 * * * * /srv/dpaste.de/bin/python /srv/dpaste.de/bin/manage.py cleanup_snippets > /dev/null

Note also that dpaste does not come with Django admin integration. You need to setup an register the models in an admin.py yourself.