Ticket #11919: django-dpaste-optional.diff

File django-dpaste-optional.diff, 1.9 KB (added by mike w, 15 years ago)

patch to add ENABLE_DPASTE setting

  • django/conf/global_settings.py

     
    290290DEFAULT_TABLESPACE = ''
    291291DEFAULT_INDEX_TABLESPACE = ''
    292292
     293# Whether to activate a dpaste.com form in the debug view.
     294ENABLE_DPASTE = True
     295
    293296##############
    294297# MIDDLEWARE #
    295298##############
  • django/views/debug.py

     
    517517    </ul>
    518518  </div>
    519519  {% endautoescape %}
    520   <form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post">
     520  <form action="{% if settings.ENABLE_DPASTE %}http://dpaste.com/{% endif %}"
     521      name="pasteform" id="pasteform" method="post">
    521522  <div id="pastebinTraceback" class="pastebin">
    522523    <input type="hidden" name="language" value="PythonConsole">
    523524    <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path_info|escape }}">
     
    557558Exception Type: {{ exception_type|escape }} at {{ request.path_info|escape }}
    558559Exception Value: {{ exception_value|escape }}
    559560</textarea>
     561  {% if settings.ENABLE_DPASTE %}
    560562  <br><br>
    561563  <input type="submit" value="Share this traceback on a public Web site">
     564  {% endif %}
    562565  </div>
    563566</form>
    564567</div>
  • docs/ref/settings.txt

     
    447447
    448448Whether to use a TLS (secure) connection when talking to the SMTP server.
    449449
     450.. setting:: ENABLE_DPASTE
     451
     452ENABLE_DPASTE
     453-------------
     454
     455.. versionadded:: 1.2
     456
     457Default: ``True``
     458
     459Whether to render a form in the debug view that can submit the traceback to
     460dpaste.com.
     461
    450462.. setting:: FILE_CHARSET
    451463
    452464FILE_CHARSET
Back to Top