css樣式:https://v3.bootcss.com/css/
一,templates》cms(創建前端顯示模板)
- 複製file:///C:/Users/Administrator/Desktop/XUEXI500/AdminLTE-2.4.3/AdminLTE-2.4.3/index.html代碼到首頁中去。
- 創建base.html爲共享模塊
- 創建index.html,,調用共享模塊
-
{% extends 'cms/base.html' %} {% block title %}首頁{% endblock %} {% block content-header %} <h1>歡迎來到菁菁CMS管理系統</h1> {% endblock %}
5.修改views.py
def index(request): return render(request,'cms/index.html')
6.修改urls
from django.urls import path from . import views app_name = 'cms' urlpatterns =[ path('',views.index,name='index'), path('write_news/',views.WriteNewsView.as_view(),name='write_news'), path('news_category/',views.news_category,name='news_category'), ]
9.修改models.py邏輯(增刪改查)
-
9.tools >>Run....生成遷移腳本
》makemigrations 》migrate