初步框架搭建
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class JumpConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "jump"
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,9 @@
|
||||
from django.urls import path, include,re_path
|
||||
from jump.views import to_index,to_register,to_login
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path('', to_index, name="index_jump"), # 跳转首页界面
|
||||
path('login', to_login, name="login_jump"), # 跳转到登录页面
|
||||
path('register',to_register, name = "register_jump"), # 跳转到注册页面
|
||||
]
|
||||
@@ -0,0 +1,26 @@
|
||||
from django.shortcuts import render
|
||||
import json
|
||||
|
||||
# Create your views here
|
||||
def to_index(request):
|
||||
"""
|
||||
主界面
|
||||
"""
|
||||
site_title_first = "在星河中"
|
||||
site_title = "在星河中"
|
||||
site_one = "心之何如,有似万丈迷津,遥亘千里,其中并无舟子可渡人,除了自渡,他人爱莫能助。"
|
||||
data = {"site_title_first":site_title_first,"site_title":site_title,"site_one":site_one}
|
||||
|
||||
return render(request, "html/index.html",data)
|
||||
|
||||
def to_login(request):
|
||||
"""
|
||||
登录界面
|
||||
"""
|
||||
return render(request,"html/login.html")
|
||||
|
||||
def to_register(request):
|
||||
"""
|
||||
注册页面
|
||||
"""
|
||||
return render(request,"html/register.html")
|
||||
Reference in New Issue
Block a user