diff --git a/docs/settings.rst b/docs/settings.rst
index 7b0e082..eb92eaf 100644
--- a/docs/settings.rst
+++ b/docs/settings.rst
@@ -95,14 +95,17 @@ behavior without touching the code:
``3600 * 24 * 30 * 12 * 100`` or simpler: ``DPASTE_EXPIRE_CHOICES[2][0]``.
``DPASTE_ENABLE_GIST``
+ **Removed in Version 2.13!**
Boolean. Whether to display the Gist button for re-pasting to GitHub.
Default: ``True``
``DPASTE_DEFAULT_GIST_NAME``
+ **Removed in Version 2.13!**
String. The filename used when pasting a snippet on Github Gist.
Default: ``dpaste.de_snippet.py``
``DPASTE_DEFAULT_GIST_DESCRIPTION``
+ **Removed in Version 2.13!**
String. The filename used when pasting a snippet on Github Gist.
Default: ``dpaste.de_snippet.py``
diff --git a/dpaste/templates/dpaste/snippet_details.html b/dpaste/templates/dpaste/snippet_details.html
index 6f4e54b..83f71a2 100644
--- a/dpaste/templates/dpaste/snippet_details.html
+++ b/dpaste/templates/dpaste/snippet_details.html
@@ -48,10 +48,6 @@
{% if snippet.expire_type != 3 %}
{% trans "View Raw" %}
{% endif %}
- {% if gist %}
- {% trans "Gist" %}
- {% endif %}
{% if snippet.lexer != 'text' %}
Wordwrap
{% endif %}
diff --git a/dpaste/urls/dpaste.py b/dpaste/urls/dpaste.py
index 20713a5..1d47787 100644
--- a/dpaste/urls/dpaste.py
+++ b/dpaste/urls/dpaste.py
@@ -14,6 +14,5 @@ urlpatterns = [
url(r'^delete/$', views.snippet_delete, name='snippet_delete'),
url(r'^(?P[a-zA-Z0-9]{%d,})/?$' % L, views.snippet_details, name='snippet_details'),
url(r'^(?P[a-zA-Z0-9]{%d,})/delete/$' % L, views.snippet_delete, name='snippet_delete'),
- url(r'^(?P[a-zA-Z0-9]{%d,})/gist/$' % L, views.snippet_gist, name='snippet_gist'),
url(r'^(?P[a-zA-Z0-9]{%d,})/raw/?$' % L, views.snippet_details, {'template_name': 'dpaste/snippet_details_raw.html', 'is_raw': True}, name='snippet_details_raw'),
]
diff --git a/dpaste/views.py b/dpaste/views.py
index b7bf4d0..82e0107 100644
--- a/dpaste/views.py
+++ b/dpaste/views.py
@@ -2,7 +2,6 @@ import datetime
import difflib
import json
-import requests
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
@@ -10,7 +9,6 @@ from django.db.models import Count
from django.http import (Http404, HttpResponse, HttpResponseBadRequest,
HttpResponseRedirect)
from django.shortcuts import get_object_or_404, render
-from django.template.context import RequestContext
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.csrf import csrf_exempt
from django.views.defaults import page_not_found as django_page_not_found
@@ -23,6 +21,7 @@ from .highlight import (LEXER_DEFAULT, LEXER_KEYS, LEXER_LIST,
LEXER_WORDWRAP, PLAIN_CODE)
from .models import ONETIME_LIMIT, Snippet
+
# -----------------------------------------------------------------------------
# Snippet Handling
# -----------------------------------------------------------------------------
@@ -185,37 +184,6 @@ def snippet_diff(request, template_name='dpaste/snippet_diff.html'):
return render(request, template_name, template_context)
-def snippet_gist(request, snippet_id): # pragma: no cover
- """
- Put a snippet on Github Gist.
- """
- if not getattr(settings, 'DPASTE_ENABLE_GIST', True):
- raise Http404('Gist creation is disabled on this installation.')
-
- snippet = get_object_or_404(Snippet, secret_id=snippet_id)
- data = {
- 'description': getattr(settings, 'DPASTE_DEFAULT_GIST_DESCRIPTION', ''),
- 'public': False,
- 'files': {
- getattr(settings, 'DPASTE_DEFAULT_GIST_NAME', 'dpaste.de_snippet.py'): {
- 'content': snippet.content,
- }
- }
- }
-
- try:
- payload = json.dumps(data)
- response = requests.post('https://api.github.com/gists', data=payload)
- response_dict = response.json()
- gist_url = response_dict.get('html_url')
-
- # Github could be down, could return invalid JSON, it's rare
- except:
- return HttpResponse('Creating a Github Gist failed. Sorry, please go back and try again.')
-
- return HttpResponseRedirect(gist_url)
-
-
# -----------------------------------------------------------------------------
# Static pages
# -----------------------------------------------------------------------------