Author Archives: kowito

Django 1.1RC ออกแล้ว เตรียมพร้อมกันหรือยัง

Django 1.1RC ออกมาแล้วเมื่อวันที่ 21 กรกฏาคม ที่ผ่านมา แต่พึงระลึกว่ายังไม่ใช่ตัวหลัก แนะนำว่าอย่าเพิ่งรีบร้อนเอามาใช้ในงานจริง เพราะว่าหากโชคดี คงจะได้เห็นตัวหลักในเวลาอันไกล้ ตอนนี้จะไม่มีการแก้ไขข้อความอะไรเพิ่มตาม หากต้องการจะแปล นี่เป็นโอกาสอันดีแล้วครับ ลุยกันเลย หากต้องการจะลอง สามารถ DOwnload ได้ที่นี่

Posted in Django | Tagged , | 1 Comment

RegEx validate email for python

เขียนเว็บก็ที่ก็ต้องมานั่งเขียน validate email address ทุกที รำคาญมาก จดไว้ในนี้เสีย จะได้ไม่ต้องเสียเวลาไปค้นอีก อย่างแรกคือกฎ วุ่นวายสับสนมากมาย ไปอ่านเพิ่มเติมกันเอาเองที่นี่ IETF แต่ถ้าเอาคร่าวๆก็ตามนี้ Alpha Characters a-z and A-Z (ASCII 97-122 and 65-90) Numeric Characters (ASCII 48-57) Exclamation Point ‘!’ (ASCII 33) Number Sign ‘#’ (ASCII 35) Dollar Sign ‘$’ (ASCII 36) Percent Sign ‘%’ (ASCII 37) Ampersand ‘&’ (ASCII 38) Single Quote ”’ (ASCII 39) [...]

Posted in Python | Tagged , | 2 Comments

บรรทัดเดียวก็พอ #1 factorial

def fact(x): return (1 if x<1 else x * fact(x-1))

Posted in Programming, Python | Tagged , | 2 Comments

ติดตั้ง Django กันดีกว่า

เพราะคนดีย่อมแก้ไข คนจัญไร นั้นแก้ตัว ผมจึงสารภาพตามตรงว่าหลังจากบาร์แคมป์ บางกอก ครั้งที่ 3 แล้ว ความขี้เกียจได้จับตัวกันเป็นก้อน ไม่มีเหตุผลอื่นใดเลย เรื่องที่ติดว่าจะบล็อกเรื่องการ Deploy Django นั้นจึงยังไม่ได้ขึ้นด้วยประการฉะนี้ เกริ่นไปให้มากความ เข้าเรื่องเลยดีกว่า ก่อนอื่นเลยผมขอแยกส่วนต่างๆของโปรเจ็คออกเป็นส่วนๆ เพื่อง่ายต่อการอัพเดต Django (เอาไว้เก็บ Source code ของ django) Media (images, css, javascript) Logs ( ถ้าอยากมี logs ก็เอามันมาไว้ข้างนอกเสีย อย่าเอาไปรวมกับ source code) User-upload ( อะไรที่ user upload ขึ้นมา พึงระวัง) Project source code ( เอาไว้เก็บไฟล์โปรเจ็คของเรา มีอะไรก็อัพเดตมันตรงนี้แหละ) Configuration ( ชื่อก็บอกว่าเก็บคอนฟิก อันนี้ถ้าทำงานหลายๆ คนก็แยกเป็นโฟลเดอร์ย่อยๆ ของใครของมัน [...]

Posted in Programming | Tagged , , , , | Leave a comment

How to fix Bad settings.LANGUAGE_CODE in Satchmo

This thread describes the issue The following command will generate the locale on Unix systems. sudo locale-gen en_US

Posted in CMS, Programming | Tagged , , | Leave a comment

Magento installation instructions.

วันนี้มีโอกาสได้ทดลองใช้ CMS สำหรับ E-Commerce Website โดย @KayEss แนะนำให้ลอง Magento ดู พบว่าเข้าท่ามากมาย ลองมาดูวิธีการติดตั้งกันครับ Software requirement: Linux, Windows, or another UNIX-compatible operating system Apache Web Server (1.x or 2.x) PHP 5.2.0 or newer, with the following extensions/addons: PDO/MySQL MySQLi mcrypt mhash simplexml DOM MySQL 4.1.20 or newer InnoDB storage engine A Sendmail-compatible Mail Transfer Agent (MTA) Magento [...]

Posted in CMS | Tagged , , , , , | 1 Comment

Satchmo Django E-Commerce CMS

Installing Dependencies- easy_install pycrypto – easy_install http://code.enthought.com/enstaller/eggs/rhel/3/Reportlab-2.1.0001-py2.5.egg – easy_install django-registration – easy_install http://tinyforge.org/frs/download.php/1/trml2pdf.tar.gz – easy_install PyYAML sudo apt-get install python-trml2pdf Install Django download Django stable version from http://www.djangoproject.com/download/1.0.2/tarball/ Installing Satchmo into your path make new project – django-admin.py startproject mystore uncompress satchmo setupSatchmo – sudo python setup.py install

Posted in CMS | Tagged , , , | Leave a comment

You Scored as Neo

You Scored as Neo You are Neo. Neo 100% Oracle 94% Seraph 88% Morpheus 88% The Merovingian 69% Agent Smith 63% Trinity 50% Niobe 6%

Posted in ไม่มีหมวดหมู่ | Leave a comment

Base Place

Base Place สถานที่แห่งความสูข ที่ผมจะหนีคนทั้งโลก มาระบายอะไรที่ไม่มีใครรู้ ที่เป็นความลับ ที่แห่งเดียวที่รู้สึกว่าเขียนได้อย่างอบอุ่นใจ หวังว่ามันจะเป็นอย่างนี้ตลอดไป

Posted in ไม่มีหมวดหมู่ | Leave a comment

Which Transformer are you?

Bumblebee As an Autobot spy, Bumblebee is the ultimate robot in disguise. What he lacks in size and strength, he makes up for with courage. He enjoys the company of humans and would do anything for his Earthly friends. Like Bumblebee, you are good by nature. But beware because mischievous thoughts sometimes tempt you. You [...]

Posted in ไม่มีหมวดหมู่ | Leave a comment