Skip to content

Latest commit

 

History

History

tutorial2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Tutorial 2 建立 Django APP

Step 1

在 Django 專案根目錄輸入
django-admin startapp your_app_name
此時專案結構應該會長這樣   project
├─app
│        ├─migrations.py
│        │        └─__init__.py
│        ├─__init__.py
│        ├─admin.py
│        ├─apps.py
│        ├─models.py
│        ├─tests.py
│        └─views.py
├─project
│        ├─__init__.py
│        ├─settings.py
│        ├─urls.py
│        └─wsgi.py
└─manage.py  

Step 2

打開settings.py   找到INSTALLED_APPS
將剛剛創建的 APP 加入到INSTALLED_APPS底部變成

INSTALLED_APPS = [
	...,
    'your_app_name',
]

若想將顯示語言改為繁體中文,在settings.py內,找到LANGUAGE_CODE,將en-us改成zh-hant

LANGUAGE_CODE = 'zh-hant'

要修改時區變成台北時間,一樣在settings.py內,找到TIME_ZONE,修改成Asia/Taipei

TIME_ZONE = 'Asia/Taipei'