[Django v2.0 (1)]安裝與開啟第一個Server

天道酬勤
Sep 8, 2018 · 2 min read

[Django(1)]安裝與開啟第一個Server

簡介

Django是一個開放原始碼的Web應用框架,由Python寫成。採用了MVT的軟體設計模式,即模型Model,視圖View和模板Template。它最初是被開發來用於管理勞倫斯出版集團旗下的一些以新聞內容為主的網站。

目前網路上的Django 教學皆為v1.xx版本,因此我打算藉由官方提供的v2.XX教學文件寫出幾篇關於Django v2.xx的教學文


建置環境

先開啟命令提式字元(cmd)

安裝Django :

pip install django

進入專案位置 : 如(D:\pyWeb)

cd D:\pyWeb
D:

建立專案資料夾: 若執行此命令時失敗,可參考下列網址 [Django debug]django-admin.py startproject mysite 失敗

django-admin startproject mysite

進入網頁執行檔所在目錄

cd mysite

執行Server

python manage.py runserver

瀏覽器測試: 開啟瀏覽器->輸入http://127.0.0.1:8000/

成功完成您的第一個Django Server!!!


天道酬勤

Written by

藉由這個Blog紀錄與分享自己學習的過程

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade