Swagger UI Ready

This commit is contained in:
2026-08-05 18:20:53 -05:00
parent 7485103bb2
commit 91dbb675d4
10 changed files with 610 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
{% load static %}<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Docs - Packs Site</title>
<link rel="stylesheet" href="{% static 'vendor/swagger-ui/swagger-ui.css' %}">
<style>
html, body { margin: 0; padding: 0; background: #1c2022; }
#swagger-ui { min-height: 100vh; }
.swagger-ui .topbar { display: none; }
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="{% static 'vendor/swagger-ui/swagger-ui-bundle.js' %}"></script>
<script>
(function () {
document.documentElement.classList.add('dark-mode');
const specUrl = "{% url 'api:docs_spec' %}";
window.ui = SwaggerUIBundle({
url: specUrl,
dom_id: '#swagger-ui',
deepLinking: true,
displayRequestDuration: true,
presets: [SwaggerUIBundle.presets.apis],
layout: 'BaseLayout',
});
})();
</script>
</body>
</html>
@@ -20,6 +20,7 @@
Send credentials as <code>Authorization: Bearer &lt;username&gt; &lt;token&gt;</code>,
e.g. <code>Authorization: Bearer {{ request.user.username }} &lt;token&gt;</code>
</p>
<p><a href="{% url 'api:docs' %}" class="btn btn-secondary btn-sm"><i class="fas fa-book"></i> Interactive API Docs</a></p>
<form method="post" action="{% url 'profiles:token_create' %}" class="token-create">
{% csrf_token %}