ติดตั้ง Django กันดีกว่า
เพราะคนดีย่อมแก้ไข คนจัญไร นั้นแก้ตัว ผมจึงสารภาพตามตรงว่าหลังจากบาร์แคมป์ บางกอก ครั้งที่ 3 แล้ว ความขี้เกียจได้จับตัวกันเป็นก้อน ไม่มีเหตุผลอื่นใดเลย เรื่องที่ติดว่าจะบล็อกเรื่องการ Deploy Django นั้นจึงยังไม่ได้ขึ้นด้วยประการฉะนี้
เกริ่นไปให้มากความ เข้าเรื่องเลยดีกว่า ก่อนอื่นเลยผมขอแยกส่วนต่างๆของโปรเจ็คออกเป็นส่วนๆ เพื่อง่ายต่อการอัพเดต
- Django (เอาไว้เก็บ Source code ของ django)
- Media (images, css, javascript)
- Logs ( ถ้าอยากมี logs ก็เอามันมาไว้ข้างนอกเสีย อย่าเอาไปรวมกับ source code)
- User-upload ( อะไรที่ user upload ขึ้นมา พึงระวัง)
- Project source code ( เอาไว้เก็บไฟล์โปรเจ็คของเรา มีอะไรก็อัพเดตมันตรงนี้แหละ)
- Configuration ( ชื่อก็บอกว่าเก็บคอนฟิก อันนี้ถ้าทำงานหลายๆ คนก็แยกเป็นโฟลเดอร์ย่อยๆ ของใครของมัน หรือถ้าทำคนเดียวก็เป็นโฟลเดอร์ย่อยอีกนั่นแหละ เผื่อมีคนรู้ใจเข้ามาทำด้วย จะได้ขยับขยายได้ง่าย)
- Extension ect…(extension, libary, python packages อย่างผมผมก็มี sorl, django-threaded-multihos, ReportLab)
ง่ายต่อการอัพเดตยังไง เมื่อต้องการอัพเดต django หรือ extension อื่นๆ เราสามารถที่จะเปลี่ยนเฉพาะส่วนนั้นๆ โดยที่ไม่กระทบกับโปรเจคอื่นๆของเราได้ อย่างเช่นใน server มีอยู่ห้าโปรเจค ที่ใช้งาน Django เหมือนกัน แต่ต่างกันที่เวอร์ชั่น เราสามารถอัพเดต Django ในโปรเจคของเรา โดยที่ไม่ทำให้เกิการเปลี่ยนแปลงในโปรเจ็คอื่นๆ
สิ่งที่ต้องระวังเป็นพิเศษคือ ห้ามเก็บอะไรก็ตาม ที่ User upload ขึ้นมาไว้รวมกับ Source code ของคุณอย่างเด็ดขาด การทำอย่างนั้นไม่ต่างอะไรกับเกิดเปิดประตูบ้านแล้วบอกว่า “เฮ้ย hack กูที”
ขั้นตอนต่อไป สร้างไฟล์ vhost ของ Apache (วั้นนี้จะใช้ mod_python WSGI ก่อน เพราะว่าไม่รู้ว่า FastCGI ทำยังไง เดี๋ยววันหลังลอง FastCGI แล้วจะมาบอก)
แต่ตอนนี้ บอลกำลังจะมา ต่อพรุ่งนี้แล้วกันนะครับ
Filed under: Programming | Leave a Comment
Tags: Apache, Deployment, Django, mod_python, WSGI
This thread describes the issue
The following command will generate the locale on Unix systems.
sudo locale-gen en_US
Filed under: CMS, Programming | Leave a Comment
Tags: Bux fix, Locale, Satchmo
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 will connect directly to an SMTP server if you don’t have an MTA
Installation
- install necessories packages.
sudo apt-get install php5-mhash php5-mcrypt php5-mysql
- Download the .zip, .tar.bz2 or .tar.gz file from the Magento website and decompress it.
tar -xvf magento-1.3.1.tar.bz2 magento/
- Create a MySQL database and user/password for Magento
- Ensure that the directories app/etc ,var , and media are writable by the web server.
cd magento
sudo chmod -R www-data:www-data app/etc
sudo chmod -R www-data:www-data var/
sudo chmod -R www-data:www-data media/
if you can’t chown you can chmod to status 777
- Make vhost for magento site
- Add new vhost for magento
sudo gedit /etc/apache2/sites-available/magento
Add vhost and save as magento
<VirtualHost *:80>
DocumentRoot /home/kowito/Projects/magento
ServerName magento.caravaggio.felspar.net
</VirtualHost>
- Enable site
sudo a2ensite magento
- reload apache configuration
sudo /etc/init.d/apache2 reload
- Add new vhost for magento
Now use your web browser to surf to the Magento installation wizard http://magento.caravaggio.felspar.net .
License agreement

Insert localize information(i can’t see UK currency)

Database configuration

Create admin account

Well done!!

First homepage!!

Backend !!

Backend interface

Filed under: CMS | Leave a Comment
Tags: CMS, E-Commerce, Installation Instructions, Magento, MySQL, PHP
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
Filed under: CMS | Leave a Comment
Tags: CMS, Django, E-Commerce, Satchmo
Hello world!
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
Filed under: Uncategorized | Leave a Comment
ค้นหา
-
Blogroll