HaveSnippet is a self-hosted paste service written in Python using the Django framework.
- As little overhead as possible
- Syntax highlight using pygments
- Optional limit on paste expiration for anonymous users
- Simple API, authentication with API keys
- CLI client
See it running at https://paste.vpsfree.cz.
- Python 3.4
- Django 1.10, might work with other versions
Clone this repository and create
havesnippet/local_settings.py. You should
SECRET_KEY and possibly
STATIC_ROOT, see Django documentation for more information about these.
Next, run database migrations:
$ python manage.py migrate --settings=havesnippet.local_settings
It is necessary to install languages to database:
$ python manage.py loadlanguages all --settings=havesnippet.local_settings
Then you can try the development server:
$ python manage.py runserver --settings=havesnippet.local_settings
Expired snippets are deleted using manage.py command
$ python manage.py expiresnippets --settings=havesnippet.local_settings
This command should be called in regularly, e.g. every 10 minutes.
False, enable/disable paste for anonymous users (
SNIPPET_PUBLIC_MAX_EXPIRATION- Integer, max expiration for anonymous users in seconds.
Falsedisables this limit. (
SNIPPET_SLUG_LENGTH- the length of snippet slug in URL (8)
SNIPPET_SLUG_CHARS- a string of characters that can appear in the slug