You are hereBlogs > sugree's blog > Hello, World!

Hello, World!


By sugree - Posted on 10 September 2008

ต่อเนื่องจากคราวที่แล้ว ทุกอย่างพร้อม อย่าลืม

svn update

ได้เวลาเขียนโปรแกรมที่ง่ายที่สุด Hello, World! สิ่งแรกที่ต้องทำคือหาสถานที่เหมาะๆ แล้วสร้างโปรเจค

django-admin.py startproject samplesite

ผลที่ได้คือ samplesite

samplesite/
samplesite/manage.py
samplesite/__init__.py
samplesite/settings.py
samplesite/urls.py

อย่าพึ่งงง นึกไม่ออกรันก่อน

cd samplesite
python manage.py runserver

แล้วเปิดเบราเซอร์ไปที่ http://localhost:8000/ ก็ควรจะเจอข้อความ

It worked! Congratulations on your first Django-powered page.

ง่ายจริงๆ

อย่างนี้ Django น่าะจะมาพร้อมกับ app server ของตัวเองเหมือน rails, grails ใช่มั้ยครับ ยี่ห้ออะไรครับ

sugree's picture

ไม่ใช่แฮะ อันนี้เป็นโหมดพัฒนา ตอนใช้จริงบอกให้ใช้ wsgi

มารอดูวิธี Implement จริงๆครับสนุกดี

เอาไปแก้ปัญหาเบื้องต้นพอได้

อยากทราบเรื่อง unit test เยอะๆจะดีมากครับ