Skip to main content

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

Project description

https://travis-ci.org/bartTC/dpaste.png?branch=master https://coveralls.io/repos/bartTC/dpaste/badge.png?branch=master https://pypip.in/v/dpaste/badge.png https://pypip.in/d/dpaste/badge.png

dpaste is a Django based pastebin. It’s intended to run separately 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:

$ cd dpaste/
$ 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:

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

Integrate dpaste into an existing project

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

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

pip install 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dpaste-2.1.tar.gz (122.5 kB view details)

Uploaded Source

File details

Details for the file dpaste-2.1.tar.gz.

File metadata

  • Download URL: dpaste-2.1.tar.gz
  • Upload date:
  • Size: 122.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dpaste-2.1.tar.gz
Algorithm Hash digest
SHA256 c4472b8d81a63bc4d7dfce214b07a674257bb59f585cd2e964ac095ebd670db4
MD5 95827f3dd380deb280d4fee0f23f3b6d
BLAKE2b-256 2214f0cc803a7c973fc808e9047ef750e54c2d77424bf87a003455823c00cece

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page