django-paste

Pluggable, configurable, pastebin HTTP REST API


Keywords
django, django-rest-framework, pastebin, pygments, python, python3, rest-api
License
MIT
Install
pip install django-paste==1.1.3

Documentation

django-paste

Pluggable, configurable, pastebin HTTP REST API

PyPI PyPI - License PyPI - Python Version Coverage Build Status Documentation Status

django-paste is a simple Django pluggable app of a code pasting and highlighting HTTP REST API, written using Django REST framework. It supports the CRUD operations on source code snippets and uses any existing user authentication system. Syntax highlighting is powered by Pygments.

Installation

The following Python versions are supported:

  • CPython: 3.6, 3.7, 3.8, 3.9
  • PyPy: 3.6

Django:

  • 2.0, 2.1, 2.2
  • 3.0, 3.1
  • Install via pip:

    $ pip install django-paste
  • Add it to your INSTALLED_APPS:

    INSTALLED_APPS = [
        # ...
        'paste.apps.PasteConfig',
    ]
  • Register the app's URLs under a path of your choice:

    urlpatterns = [
        # ...
        path('some-path/', include('paste.urls')),
    ]

    where 'some-path/' could be any URL.

  • Optionally, configure the app settings.

  • Generate and run the database migrations:

    $ python manage.py makemigrations paste
    $ python manage.py migrate

Usage

You can find the description of the app's endpoints and snippet fields in the documentation. You can also manage snippets at the Django admin site.

License

Distributed under the MIT License.