---
# System prepended metadata

title: 'Django 2.0 文章集 [7] 簡易電商網站'
tags: [python, Django, django2.0]

---

#  Django 2.0 文章集 [7] 簡易電商網站

###### tags: `Django`, `django2.0`, `python`

#### (base) C:\Users\user>virtualenv onlineshopenv --python=python3.6

#### (base) C:\Users\user>cd C:\Users\user\onlineshopenv\Scripts

#### (..env)>pip install Django==2.0.5

#### (..env)>C:\Users\user\onlineshopenv\Scripts\python.exe -m pip install --upgrade pip

## 套件版本
 Django     2.0.5
 pip        21.0.1
 pytz       2021.1
 setuptools 51.3.3
 wheel      0.36.2

#### (..env)>d:
#### (..env)>cd D:\Programs\Python\django\django2.0

#### (..env)>django-admin startproject myshop
#### (..env)>cd myshop
#### (..env)>python manage.py runserver
#### (..env)>django-admin startapp shop*

##  定義模型類 shop/models.py

(..env)>pip install Pillow==5.1.0

##  生成遷移文件
##   => shop\migrations\0001_initial.py
(..env)>python manage.py makemigrations shop

##  遷移
(..env)>python manage.py migrate

##  管理後台添加模型 shop/admin.py
