目录结构大致如下所示
/apps
/api
/urls.py
/domain
/views.py
/host
/vies.py
/SecurityAssert
/urls.py
:::info /SecuirtyAssert/urls.py :::
from django.urls import path, include
urlpatterns = [
path('api/', include('apps.api.urls')),
]
:::info /apps/api/urls.py :::
from apps.domain import views as domain_views
from apps.host import views as host_views
urlpatterns = [
path('domains/', domain_views.DomainList.as_views()),
path('domains/<int:pk>/', domain_views.DomanDetails.as_views()),
path('hosts/', host_views.HostList.as_views()),
path('hosts/<int:pk>/', host_views.HostDetails.as_views()),
]