The Django project driving dpaste.org
Find a file
2013-12-18 10:07:40 +01:00
dpaste Added csrf support. Closes issue #34. 2013-12-17 22:52:21 +01:00
server Added newrelic support 2013-11-30 11:33:54 +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 Restrict Travis to build master and develop only. No need to con-test feature branches 2013-12-02 21:31:32 +01:00
CHANGELOG Support for python setup.py test to run the tox suite. 2013-12-18 10:06:22 +01:00
LICENSE Numerous fixes around package management. Kudos to @koobs. 2013-12-14 13:17:53 +01:00
manage.py Removed my private info. 2013-11-29 19:35:23 +01:00
MANIFEST.in Added README and test related files to the MANIFEST so you could test with the package too. 2013-12-17 18:10:04 +01:00
README.rst Removed stat images which no longer work. They were not fancy anyway. 2013-12-18 00:32:39 +01:00
requirements.txt Added newrelic support 2013-11-30 11:33:54 +00:00
runtests.py Fixed tox version 2013-11-26 12:29:34 +01:00
setup.py No need to require a specific tox version but nothing older what I use here. 2013-12-18 10:07:40 +01:00
tox.ini Support for python setup.py test to run the tox suite. 2013-12-18 10:06:22 +01:00

======
dpaste
======

.. image:: https://travis-ci.org/bartTC/dpaste.png?branch=master
    :target: https://travis-ci.org/bartTC/dpaste
.. image:: https://coveralls.io/repos/bartTC/dpaste/badge.png?branch=master
    :target: https://coveralls.io/r/bartTC/dpaste?branch=master

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

.. _Travis: https://travis-ci.org/bartTC/dpaste
.. _tox: http://tox.readthedocs.org/en/latest/

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