api home template
This commit is contained in:
parent
eba7f16374
commit
49cc0dcf58
@ -4,6 +4,7 @@ from django.urls import path, include
|
|||||||
from rest_framework.authtoken.views import obtain_auth_token
|
from rest_framework.authtoken.views import obtain_auth_token
|
||||||
|
|
||||||
from .views import (
|
from .views import (
|
||||||
|
APIHome,
|
||||||
SubChannel_ListView,
|
SubChannel_ListView,
|
||||||
SubChannel_DetailView,
|
SubChannel_DetailView,
|
||||||
Filter_ListView,
|
Filter_ListView,
|
||||||
@ -22,6 +23,7 @@ from .views import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path("", APIHome.as_view(), name="home"),
|
||||||
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
|
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
|
||||||
path("api-token-auth/", obtain_auth_token),
|
path("api-token-auth/", obtain_auth_token),
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import logging
|
|||||||
from django.db.models import Subquery
|
from django.db.models import Subquery
|
||||||
from django.db.utils import IntegrityError
|
from django.db.utils import IntegrityError
|
||||||
from django_filters import rest_framework as rest_filters
|
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 import status, permissions, filters, generics
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.pagination import PageNumberPagination
|
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
|
return user.user_type == DiscordUser.USER_TYPES.AUTOMATED_USER and user.is_superuser
|
||||||
|
|
||||||
|
|
||||||
|
class APIHome(TemplateView):
|
||||||
|
template_name = "rest_framework/api.html"
|
||||||
|
|
||||||
|
|
||||||
# =================================================================================================
|
# =================================================================================================
|
||||||
# SubChannel Views
|
# SubChannel Views
|
||||||
|
|
||||||
|
15
apps/templates/rest_framework/_api.html
Normal file
15
apps/templates/rest_framework/_api.html
Normal 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 %}
|
Loading…
x
Reference in New Issue
Block a user