หน้าเว็บ

วันพุธที่ 28 มกราคม พ.ศ. 2558

CHAPTER 1 Getting Django Set Up Using a Functional Test

::function test --> เป็นการทดสอบในมุมมองของ user ทดสอบตามเรื่องราว รู้แค่โครงสร้างผลลัพธ์ที่แสดงออกมาแต่ไม่รู้การทำงานข้างในของโค้ด


-- สร้าง functional_tests.py.  ใน gedit



-- เปิด terminal ใหม่เข้าไปใน file superlists เปิด server
python3 manage.py runserver




-- code : python3 functional_tests.py



-- บันทึก functional_tests.py ใน superlists



code :
$ ls superlists functional_tests.py
$ mv functional_tests.py superlists/
# move file
$ cd superlists
$ git init .
# to start the repository เริ่มสร้างพื้นที่เก็บที่ว่าง
$ ls
$ echo "db.sqlite3" >> .gitignore
$ git add .
$ git status

-- Let’s remove them from Git and add them to .gitignore too
: git rm -r --cached superlists/__pycache__
# remove them from Git
: echo "__pycache__" >> .gitignore
# __pycache__ เป็นฐานข้อมูล เราไม่ต้องการที่จะควบคุมไฟล์และเพิ่มไปยังไฟล์พิเศษ เรียก .gitignore
: echo "*.pyc" >> .gitignore
: git status
#show status file


-- ก่อน git commit จะขึ้นอยากรู้ว่าเราเป็นใคร ให้
ให้ใส่   git config  -- global user.email
         git config  -- global user.name

code : $ git add .gitignore $ git commit
# จะขึ้นหน้าต่างแก้ไขข้อความให้เราพิมพ์ข้อความของเราที่ต้องการจะใส่ลงไป จากนั้นกดออกและบันทึก ctrl+x-->y(yes)-->enter


ไม่มีความคิดเห็น:

แสดงความคิดเห็น