{% extends 'core/base.html' %} {% load humanize %} {% block content %}
API 说明
API 说明

端点:

POST /api/v1/temp-upload/

参数:

cURL:

curl -X POST \
  -F "file=@f.pdf" \
  -F "title=文件" \
  -F "expire_type=expire_1d" \
  /api/v1/temp-upload/

公开内容

{% if user.is_authenticated %} 添加内容 {% endif %}
临时发言 留言仅保留10分钟
{% csrf_token %}
{% if temp_messages %}
{% for message in temp_messages %}
{{ message.username|default:"匿名" }} {{ message.created_at|naturaltime }}

{{ message.content }}

IP: {{ message.ip_address|default:"未知" }}
{{ message.created_at|naturaltime }}
{% endfor %}
{% else %}

暂无留言

{% endif %}
{% if content_by_type %} {% for type_name, contents in content_by_type.items %}
{{ type_name }}
{{ contents|length }} 项
{% for content in contents %}
{% if content.url %} {{ content.title }} {% else %} {{ content.title }} {% endif %} {% if content.is_temp_file %} 临时文件 {% endif %}
{% if content.content %}

{{ content.content|truncatechars:200 }}

{% endif %} {% if content.file %} 下载文件 {% endif %} {% if content.is_temp_file and content.expire_at %} {{ content.expire_at|naturaltime }}过期 {% endif %}
{% if user.is_authenticated %} {% endif %}
{% endfor %}
{% endfor %} {% else %}
暂无公开内容

请稍后再来查看

{% if user.is_authenticated %} 添加内容 {% endif %}
{% endif %}
{% csrf_token %}
{% endblock %}