Ver Fonte

# feat:初始化newApp

yht há 3 semanas atrás
pai
commit
f2aeedb70f

+ 0 - 0
pythonweb/newsApp/__init__.py


+ 3 - 0
pythonweb/newsApp/admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.

+ 5 - 0
pythonweb/newsApp/apps.py

@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class NewsappConfig(AppConfig):
+    name = 'newsApp'

+ 0 - 0
pythonweb/newsApp/migrations/__init__.py


+ 3 - 0
pythonweb/newsApp/models.py

@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.

+ 3 - 0
pythonweb/newsApp/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 10 - 0
pythonweb/newsApp/urls.py

@@ -0,0 +1,10 @@
+from django.urls import path
+from . import views
+
+app_name = 'newsApp'
+
+urlpatterns = [
+    path('company/', views.company, name='company'),     # 公司要闻
+    path('industry/', views.industry, name='industry'),  # 行业新闻
+    path('notice/', views.notice, name='notice'),        # 通知公告
+]

+ 18 - 0
pythonweb/newsApp/views.py

@@ -0,0 +1,18 @@
+from django.shortcuts import render
+from django.shortcuts import HttpResponse
+
+
+# Create your views here.
+def company(request):
+    html = '<html><body>公司要闻</body></html>'
+    return HttpResponse(html)
+
+
+def industry(request):
+    html = '<html><body>行业新闻</body></html>'
+    return HttpResponse(html)
+
+
+def notice(request):
+    html = '<html><body>通知公告</body></html>'
+    return HttpResponse(html)