Compare commits

...

1 Commits

Author SHA1 Message Date
49cc0dcf58 api home template 2024-08-26 20:06:23 +01:00
3 changed files with 22 additions and 0 deletions

View File

@ -4,6 +4,7 @@ from django.urls import path, include
from rest_framework.authtoken.views import obtain_auth_token
from .views import (
APIHome,
SubChannel_ListView,
SubChannel_DetailView,
Filter_ListView,
@ -22,6 +23,7 @@ from .views import (
)
urlpatterns = [
path("", APIHome.as_view(), name="home"),
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
path("api-token-auth/", obtain_auth_token),

View File

@ -5,6 +5,7 @@ import logging
from django.db.models import Subquery
from django.db.utils import IntegrityError
from django_filters import rest_framework as rest_filters
from django.views.generic import TemplateView
from rest_framework import status, permissions, filters, generics
from rest_framework.response import Response
from rest_framework.pagination import PageNumberPagination
@ -41,6 +42,10 @@ def is_automated_admin(user):
return user.user_type == DiscordUser.USER_TYPES.AUTOMATED_USER and user.is_superuser
class APIHome(TemplateView):
template_name = "rest_framework/api.html"
# =================================================================================================
# SubChannel Views

View File

@ -0,0 +1,15 @@
{% extends "rest_framework/base.html" %}
{% load static %}
{% block bootstrap_theme %}
<link type="text/css" rel="stylesheet" href="{% static '/css/bootstrap.css' %}" />
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
{% endblock bootstrap_theme %}
{% block content %}
<main>
<section title="Page Header">
<div class="page-header">{{ name }}</div>
</section>
</main>
{% endblock content %}