local library

1. Create Project and App

mkdir django_projects

cd django_projects

django-admin startproject locallibrary

cd locallibrary

python manage.py startapp catalog

2. Project settings

/locallibrary/settings.py

INSTALL_APPS = ['catalog',]

或者 

INSTALL_APPS = ['catalog.apps.CatalogConfig',] ,  /locallibrary/catalog/apps.py

DATABASES = {}

LANGUAGE_CODE = 'zh-hans'

TIME_ZONE = 'Asia/Shanghai'

3. URL mapper

/locallibrary/urls.py

create a file inside catalog folder called urls.py

catalog/urls.py

4. Database migrations

python manage.py makemigrations

python manage.py migrate

posted @ 2020-04-12 20:09  科德科技  阅读(163)  评论(0)    收藏  举报