diff --git a/EduSystemServer/API/__init__.py b/EduSystemServer/API/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/EduSystemServer/API/admin.py b/EduSystemServer/API/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/EduSystemServer/API/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/EduSystemServer/API/apps.py b/EduSystemServer/API/apps.py new file mode 100644 index 0000000..6cf3fc3 --- /dev/null +++ b/EduSystemServer/API/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ApiConfig(AppConfig): + name = 'API' diff --git a/EduSystemServer/API/migrations/__init__.py b/EduSystemServer/API/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/EduSystemServer/API/models.py b/EduSystemServer/API/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/EduSystemServer/API/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/EduSystemServer/API/tests.py b/EduSystemServer/API/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/EduSystemServer/API/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/EduSystemServer/API/urls.py b/EduSystemServer/API/urls.py new file mode 100644 index 0000000..076f242 --- /dev/null +++ b/EduSystemServer/API/urls.py @@ -0,0 +1,21 @@ +"""EduSystemServer URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from API import views +from django.urls import path + +urlpatterns = [ + path("students/", views.student) +] diff --git a/EduSystemServer/API/views.py b/EduSystemServer/API/views.py new file mode 100644 index 0000000..0d36511 --- /dev/null +++ b/EduSystemServer/API/views.py @@ -0,0 +1,7 @@ +from django.shortcuts import render +from django.http import JsonResponse +# Create your views here. + + +def student(request): + return JsonResponse({"sid": 1, "sname":"张三"})