建立專案news
#django-admin startproject news
新增應用程式article
#cd news
#python manage.py startapp article
Step1)編輯news\settings.py,在INSTALLED_APPS內新增應用程式article,TEMPLATES的DIRS新增templates
編輯news\urls.py
編輯article\models.py
編輯article\forms.py
編輯article\views.py
編輯article\urls.py,有兩種新增最新消息方式create與create2,選擇其中一種方式新增公告即可。
編輯article\admin.py
編輯templates\base.html
編輯article\templates\article_create.html
編輯article\templates\article_list.html
編輯article\article_detail.html
編輯article\article_update.html
編輯article\article_delete.html
列出所有公告,點選「新增公告」
輸入標題、內容與附件,點選「儲存」
最下方新增了一個公告,點選「修改」可以編輯公告,點選「刪除」可以刪除公告,點選「明細」只顯示該公告