pasteque/paste/templates/paste/index.html

47 lines
1.4 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% load filters %}
{% load i18n %}
{% load compress %}
{% block content %}
<h1>Paf'Py</h1>
<p>Et Paf.</p>
<p>Ce « pastebin-like » sutilise en ligne de commande, soit avec <tt>curl</tt> :</p>
<div class="highlight"><pre><span></span>curl {{ request.build_absolute_uri }} <span class="o">-F</span>hello.py<span class="o">=</span>@hello.py
</pre></div>
<p>Mais le mieux est de l'utiliser avec une fonction <tt>bash</tt> :</p>
<div class="highlight"><pre><span></span>pafpy<span class="o">()</span>
<span class="o">{</span>
curl {{request.build_absolute_uri}} -F<span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">=@</span><span class="nv">$1</span><span class="s2">&quot;</span>
<span class="o">}</span>
</pre></div>
Demo :
<div class="highlight"><pre><span></span>$ pafpy manage.py
https://p.afpy.org/g3LE
</pre></div>
It can be viewed from a browser with nice colors (check
it: <a href="https://p.afpy.org/g3LE">https://p.afpy.org/g3LE</a>), or
it can be downloaded back "raw":
<div class="highlight"><pre><span></span>$ curl https://p.afpy.org/g3LE
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webtools.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
</pre></div>
{% endblock %}