Ver código fonte

# feat:初始化contentApp

yht 3 semanas atrás
pai
commit
d8f2385af0

+ 0 - 0
pythonweb/contactApp/__init__.py


+ 3 - 0
pythonweb/contactApp/admin.py

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

+ 5 - 0
pythonweb/contactApp/apps.py

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

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


+ 3 - 0
pythonweb/contactApp/models.py

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

+ 3 - 0
pythonweb/contactApp/tests.py

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

+ 9 - 0
pythonweb/contactApp/urls.py

@@ -0,0 +1,9 @@
+from django.urls import path
+from . import views
+
+app_name = 'contactApp'
+
+urlpatterns = [
+    path('contact/', views.contact, name='contact'),  # 欢迎咨询
+    path('recruit/', views.recruit, name='recruit'),    # 加入恒达
+]

+ 13 - 0
pythonweb/contactApp/views.py

@@ -0,0 +1,13 @@
+from django.shortcuts import render
+from django.shortcuts import HttpResponse
+
+
+# Create your views here.
+def contact(request):
+    html = '<html><body>欢迎咨询</body></html>'
+    return HttpResponse(html)
+
+
+def recruit(request):
+    html = '<html><body>加入恒达</body></html>'
+    return HttpResponse(html)