An open API service indexing awesome lists of open source software.

https://github.com/amikrop/django-paste

Pluggable, configurable, pastebin HTTP REST API
https://github.com/amikrop/django-paste

django django-rest-framework pastebin pygments python python3 rest-api

Last synced: 6 months ago
JSON representation

Pluggable, configurable, pastebin HTTP REST API

Awesome Lists containing this project

README

          

django-paste
============

Pluggable, configurable, pastebin HTTP REST API
-----------------------------------------------

.. image:: https://img.shields.io/pypi/v/django-paste.svg
:target: https://pypi.org/project/django-paste/
:alt: PyPI

.. image:: https://img.shields.io/pypi/l/django-paste.svg
:target: https://pypi.org/project/django-paste/
:alt: PyPI - License

.. image:: https://img.shields.io/pypi/pyversions/django-paste.svg
:target: https://pypi.org/project/django-paste/
:alt: PyPI - Python Version

.. image:: https://codecov.io/gh/amikrop/django-paste/branch/master/graph/
badge.svg
:target: https://codecov.io/gh/amikrop/django-paste/
:alt: Coverage

.. image:: https://readthedocs.org/projects/django-paste/badge/?version=latest
:target: https://django-paste.readthedocs.io/en/latest/?badge=latest
:alt: 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
`_:

.. code-block:: bash

$ pip install django-paste

- Add it to your ``INSTALLED_APPS``:

.. code-block:: python

INSTALLED_APPS = [
# ...
'paste.apps.PasteConfig',
]

- Register the app's URLs under a path of your choice:

.. code-block:: python

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:

.. code-block:: bash

$ 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
`_.