วันพุธที่ 30 มีนาคม พ.ศ. 2559
Adviser meeting 31/03/2559
สิ่งที่ดำเนินการไปแล้ว1. ทดลองใช้ Aldryn_newsblog สร้างบทความประกาศแล้ว เราดึง object ของบทความมาแสดงในหน้าที่เราต้องการ http://anounceprojectcpre55.blogspot.com/2016/03/article-aldrynnewsblog.html
2. โหลด ChromiumOS สำหรับ Raspberry pi2
3. ทดลองเล่น video โดยใช้ html5 แทน flash ทำให้เล่นวิดิโอใน django cms ได้
4. ตัดต่อวิดิโอความคืบหน้า
สิ่งที่จะดำเนินการต่อ
1. เปลี่ยนหน้า default เป็นเอกลักษณ์ของ project
2. อธิบายโค้ดส่วน ขยายปลั๊กอินเดิมของ cms
3. เตรียม slide present project
4 . แก้ไข video จองห้องล่วงหน้า
วันอังคารที่ 29 มีนาคม พ.ศ. 2559
Infomation link
http://django-filer.readthedocs.org/en/latest/extending_filer.html#using-your-new-file-typehttps://github.com/divio/cmsplugin-filer
https://github.com/divio/djangocms-video/blob/master/djangocms_video/templates/cms/plugins/video.html
https://github.com/divio/cmsplugin-blog
https://github.com/divio/djangocms-video/blob/master/djangocms_video/templates/cms/plugins/video.html
http://www.h264info.com/clips.html
http://thenewcode.com/831/HTML5-Responsive-Image-Slider-With-Captions
http://www.html5marketplace.com/slideshow/
http://www.sitepoint.com/5-free-html5-presentation-systems/
https://github.com/urga/djangocms-slider django cms slider
https://github.com/nephila/djangocms-revealjs django cms reveal.js
https://github.com/emencia/emencia-django-slideshows/tree/master/slideshows
https://github.com/marianoguerra/rst2html5
https://www.scribd.com/developers
https://github.com/emencia/emencia-django-slideshows
https://box-view.readme.io/reference
http://www.sitepoint.com/5-free-html5-presentation-systems/
http://scienceblogs.com/gregladen/2014/11/08/10-or-20-things-to-do-after-installing-ubuntu-mate-14-10/
http://raspberrypi.stackexchange.com/questions/45150/install-chromium-on-ubuntu-mate-raspberry-pi
https://ubuntu-mate.community/t/install-chromium-how/3010
http://www.tdd-django-tutorial.com/tutorial/1/
http://stackoverflow.com/questions/7276677/jquery-redirect-to-url-after-specified-time
http://stackoverflow.com/questions/3677667/delay-automatic-url-redirect-with-jquery
http://deephacks.com/articles/entry/django-and-jquery-ajax-part-1-loading-paginated-subpages/
http://deephacks.com/articles/entry/django-and-jquery-ajax-part-2-forms/
javascript library
http://tutorialzine.com/2016/02/20-interesting-javascript-and-css-libraries-for-february-2016/
http://tutorialzine.com/2016/05/15-interesting-javascript-and-css-libraries-for-may-2016/
https://getflywheel.com/layout/20-javascript-libraries-to-check-out-in-2016/
http://www.hongkiat.com/blog/scrolling-effects-js-libraries/
https://speckyboy.com/2015/12/13/javascript-resources-2015/
http://www.cssdesignawards.com/articles/best-js-plugins-and-libraries-of-2015/267/
http://tutorialzine.com/2016/01/15-interesting-javascript-and-css-libraries-for-january-2016/
django web socket
http://blog.jupo.org/2011/08/13/real-time-web-apps-with-django-and-websockets/
permission user
http://django-role-permissions.readthedocs.io/en/latest/setup.html
http://blog.narenarya.in/right-way-django-authentication.html
https://docs.djangoproject.com/ja/1.9/topics/auth/default/
django Listfield
http://stackoverflow.com/questions/5216162/how-to-create-list-field-in-django
https://gist.github.com/jonashaag/1200165
gridstack
http://troolee.github.io/gridstack.js/
Image filer
http://stackoverflow.com/questions/20635332/how-to-programmatically-fill-or-create-filer-fields-image-filerimagefield
django & ckeditor
https://webynote.com/main/community/57ab294bc57c77e4416ddca7
js test connection
http://stackoverflow.com/questions/2384167/check-if-internet-connection-exists-with-javascript
Raspberry pi 2 cpu temperature log record
https://www.raspberrypi.org/learning/temperature-log/worksheet/
set href to local
http://stackoverflow.com/questions/12021781/the-right-way-of-setting-a-href-when-its-a-local-file
detect video error while network failed
http://stackoverflow.com/questions/15898511/html-5-video-returning-playback-error-with-source-element-instead-of-attr
http://stackoverflow.com/questions/5573461/html5-video-error-handling
resolve database is locked
https://docs.djangoproject.com/en/dev/ref/databases/#database-is-locked-errorsoption
Raspberry pi with DHT22
http://thaiopensource.org/%E0%B8%A1%E0%B8%B2%E0%B9%80%E0%B8%A5%E0%B9%88%E0%B8%99-raspberry-pi-%E0%B8%81%E0%B8%B1%E0%B8%9A-dht22-%E0%B8%81%E0%B8%B1%E0%B8%99/
bootstrap tab in modal
http://www.bootply.com/QKuuimkQTC
cpu monitoring
https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=22180
ทดลองดึงเนื้อหาจาก Article ของ Aldryn_newsblog
การทดลองนี้เพื่อพิสูจน์ว่าเราจะดึงเนื้อหาจาก Article model ของ Aldryn_newsblog มาแสดงในหน้าที่เราต้องการได้หรือไม่ ที่มาคือในกรณีเราจะสร้างประกาศประเภทบทความเราจะใช้ plugin ที่สร้างไว้ให้เราใช้งานได้เลย ในที่นี้เราเลือก Aldryn_newsblog ใช้สร้างข่าวหรือบทความ สามารถใส่รูปภาพประกอบลงไปในบทความได้ มีการทำ list ของบทความให้อัตโนมัติ การทดลองของเราคือสร้างบทความมา 1 บทความเป็น model ชื่อ Article แล้วดึงเนื้อจาก Article ที่เราเขียนมาแสดงในหน้าที่เราต้องการ มีขั้นตอนดังนี้1. โหลด aldryn_newsblog จาก https://github.com/aldryn/aldryn-newsblog
2. สร้าง app ใช้ cms project ของเราชื่อ myapp
3. เขียนไฟล์ models.py ดังนี้
from cms.models.pluginmodel import CMSPlugin from django.db import models from aldryn_newsblog.models import Article class ArticleHello(CMSPlugin): article = models.ForeignKey(Article) def __unicode__(self): return self.article.translations.title
from aldryn_newsblog import Article คือเข้าถึง model ของ alryn_newsblog
4. เขียนไฟล์ cms_plugins.py ดังนี้
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext_lazy as _ from .models import ArticleHello class HelloArticle(CMSPluginBase): model = ArticleHello name = _("Hello Article") render_template = "hello_article.html" cache = False def render(self, context, instance, placeholder): context = super(HelloArticle, self).render(context, instance, placeholder) return context plugin_pool.register_plugin(HelloArticle)
@plugin_pool.register_plugin ถ้าถูกประกาศบน class ไหนแปลค่า plugin_pool.register_plugin ตัว class นั้น
5. สร้าง templates/hello_plugin.html ดังนี้
{% load i18n staticfiles thumbnail cms_tags apphooks_config_tags %} <h1>Hello Article</h1> <ul> <li>{{ instance.article.translations }}</li> <li>{{ instance.article.publishing_date }}</li> <li>{% render_model instance.article "lead_in" %}</li> </ul>
6. รันคำสั่ง python manage.py makemigrations myapp และ python manage.py migrate myapp
7. รัน server เปิดหน้าที่เราต้องการ จากนั้นเพิ่มสร้าง article โดย aldryn_newsblog มาหนึ่งบทความ จากนั้นเพิ่ม plugin ชื่อ Hello Article เลือกบทความที่เราสร้าง
จากรูปเราใช้ Hello Article มาแสดงจากนั้นก็เป็นข้อมูลต่างๆของบทความที่เราสร้าง สรุปคือเรานำ aldryn newsblog มาใช้สร้างประกาศแบบบทความได้ และเราควบคุมการแสดงเนื้อหาของบทความได้
วันพุธที่ 23 มีนาคม พ.ศ. 2559
Adviser meeting 24/03/2559
สิ่งที่ดำเนินการไปแล้ว1. ฟังก์ชันสำหรับ admin ในการสร้างประกาศมีกำหนดเวลาของประกาศ กำหนดหน้าจอที่จะแสดงของประกาศแต่ยังอัพโหลดไฟล์ประกาศที่เป็น pdf, image และ video ด้วยฟังก์ชันนี้ไม่ได้ ตอนนี้อยู่ในระหว่างพัฒนา
2. หน้าเว็บแบบคร่าวๆสำหรับระบบโดยรวมของ admin
3. ถ่าย video ความคืบหน้าของโปรเจ็ค
4. ฟังก์ชันแสดงหน้าประกาศตามเวลาที่กำหนด อยู่ในระหว่างพัฒนา
ปัญหาที่พบ
1. ไฟล์ image ubuntu 14.04 เสีย ทำให้ใช้เวลาหาตัวใหม่มาลง
2. plugin ของ django cms พวก filer, video, image และ ck-editor ยังหาวิธีนำ source code มาดัดแปลงใช้โปรเจ็คเรายังไม่ได้
3. คาดว่า django cms ไม่ได้มีส่วน source code ให้เราดัดแปลงมากนัก ถ้าไม่ใช้เวอร์ชัน develop
สิ่งที่จะดำเนินการต่อ
1. ตัดต่อ video รายงานความคืบหน้าโปรเจ็ค
2. ทำระบบสร้างประกาศของ django cms ให้ใช้ได้กับไฟล์ประกาศทุกประเภท
3. หาวิธีดัดแปลง plugin ck-editor มาใช้ในการสร้างประกาศแบบ text
4. ลองอัพโหลดไฟล์ video เก็บเป็นไฟล์แล้วใช้ url มาเล่นใน tag html5
5. pdf หลายหน้าทำเป็น slice viewer
6. slide prosent project
วันจันทร์ที่ 21 มีนาคม พ.ศ. 2559
datetime สำหรับเช็คเวลา
>>> from datetime import datetime, date, time >>> # Using datetime.combine() >>> d = date(2005, 7, 14) >>> t = time(12, 30) >>> datetime.combine(d, t) datetime.datetime(2005, 7, 14, 12, 30) >>> # Using datetime.now() or datetime.utcnow() >>> datetime.now() datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1 >>> datetime.utcnow() datetime.datetime(2007, 12, 6, 15, 29, 43, 79060) >>> # Using datetime.strptime() >>> dt = datetime.strptime("21/11/06 16:30", "%d/%m/%y %H:%M") >>> dt datetime.datetime(2006, 11, 21, 16, 30) >>> # Using datetime.timetuple() to get tuple of all attributes >>> tt = dt.timetuple() >>> for it in tt: ... print it ... 2006 # year 11 # month 21 # day 16 # hour 30 # minute 0 # second 1 # weekday (0 = Monday) 325 # number of days since 1st January -1 # dst - method tzinfo.dst() returned None >>> # Date in ISO format >>> ic = dt.isocalendar() >>> for it in ic: ... print it ... 2006 # ISO year 47 # ISO week 2 # ISO weekday >>> # Formatting datetime >>> dt.strftime("%A, %d. %B %Y %I:%M%p") 'Tuesday, 21. November 2006 04:30PM' >>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'.format(dt, "day", "month", "time") 'The day is 21, the month is November, the time is 04:30PM.'
วันอาทิตย์ที่ 20 มีนาคม พ.ศ. 2559
ทดลองแนวคิด cms กับการทำประกาศ
เราทดลองสร้าง polls_plugin ใน djangocms พบว่าเรากำหนดในแต่ละหน้าของเว็บแสดง polls ที่มีคำถามที่แตกต่างกันได้ เช่นจากรูปพบว่าในหน้า Admin announce แสดงคำถามที่แตกต่างกับหน้า news การทดลองนี้นำไปสู่แนวคิดในการใช้ประโยชน์จาก djangocms ในการเพิ่มหน้าสำหรับแสดงเนื้อหาบนหน้าจอ คือเรามองว่าเว็บมาหน้าหนึ่งแล้วเราก็กำหนดได้ว่าจะให้แสดงเนื้อหาของหน้าจออันไหน เช่นสร้างหน้าเว็บชื่อ news กำหนดให้เนื้อหาหน้าจอ1 แสดงออกหน้าเว็บนี้ แล้วเราก็นำ url ของหน้าเว็บ news นี้ไปให้ Raspberry pi ที่ต่อกับหน้าจอจริง ใช้งานแสดงผลได้
ปัญหาการแสดงเนื้อหาประกาศ
ประกาศที่เราใช้มีหลายประเภทได้แก่ pdf, image, ข้อความ, slice, video และ message เราพบว่าในกรณีประกาศที่เป็น video เราจะใช้ html5 แทน flash ในการแสดง พบว่า video ที่ support คือไฟล์ mp4 H.264 ดังนั้นเราจะไม่ใช้ plugin video ของ cms แต่เราจะใช้ html5 แทนในส่วน image, slice, pdf และ video เราทำการกำหนด MEDIA_URL และ MEDIA_ROOT ในไฟล์ settings.py เพื่อให้ข้อมูลเหล่านั้นถูกเรียกมาใช้งานได้ เช่น แสดงรูปภาพใช้ image.url เพื่อนำมาแสดงใน tag html <img src="{{object.image.url}}">
วิธีกำหนด MEDIA_URL และ MEDIA_ROOT คือเปิดไฟล์ settings.py แล้วเพิ่มโค้ด ดังนี้
STATIC_URL = '/static/' MEDIA_ROOT = '/home/osboxes/admin_announce/filer_public/' MEDIA_URL = '/home/osboxes/admin_announce/'
MEDIA_ROOT คือ path ไปยังที่เก็บไฟล์ image ,pdf หรือ video อยู่
MEDIA_URL คือ path ไปยังโปรเจ็คเรา
เพิ่มโค้ดนี้ไปใน urls.py ของโปรเจ็ค
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
หลังจากนี้เราจะเข้าถึงไฟล์เหล่านี้ด้วย url โปรเจ็คเราได้
วันอาทิตย์ที่ 13 มีนาคม พ.ศ. 2559
environment ที่ต้องการของ djangocms 3.2 using django 1.8
Pillow: sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev pip install Pillow upgrade pip: pip install --upgrade pipupgrade setuptools: pip install --upgrade setuptools upgrade ndg-httpsclient: upgrade ndg-httpsclient with pip install --upgrade ndg-httpsclient gcc python3.4: sudo apt-get install gcc python3.4-devpip list:dj-database-url (0.4.0)
Django (1.8.11)
django-classy-tags (0.7.2)
django-cms (3.2.3)
django-formtools (1.0)
django-reversion (1.8.7)
django-sekizai (0.9.0)
Django-Select2 (4.3.2)
django-treebeard (4.0)
djangocms-admin-style (1.1.0)
djangocms-column (1.6.0)
djangocms-file (1.0)
djangocms-googlemap (0.4.0)
djangocms-inherit (0.1.1)
djangocms-installer (0.8.7)
djangocms-link (1.7.2)
djangocms-picture (0.2.0)
djangocms-style (1.7.0)
djangocms-teaser (0.2.0)
djangocms-text-ckeditor (2.9.0)
djangocms-video (1.0.0)
html5lib (0.9999999)
idna (2.0)
Pillow (3.1.1)
pip (8.1.0)
pyasn1 (0.1.9)
pycparser (2.14)
pytz (2015.7)
setuptools (20.2.2)
six (1.10.0)
tzlocal (1.2.2)
urllib3 (1.14)
วันพฤหัสบดีที่ 3 มีนาคม พ.ศ. 2559
update ความคืบหน้าตั้งแต่เริ่มปี 2559 ถึง 3/03/2559
สิ่งที่ดำเนินการไปแล้ว1.สร้าง Repository ของโปรเจค บน bitbucket และทดลองการใช้งานพื้นฐานของ git2.ออกแบบขอบเขตความสามารถของโปรเจค ตามแต่ละ usecase
รายละเอียดเพิ่มเติม
http://anounceprojectcpre55.blogspot.com/2016/02/scope-description-by-use-case.html
3.สร้างโปรเจค Django cms บน ubuntu14.04
รายละเอียดเพิ่มเติม
http://anounceprojectcpre55.blogspot.com/2016/01/djangocms-1-install-on-ubuntu14043lts.html
4.ทำการขยาย cms ของเราด้วย Third-party application
รายละเอียดเพิ่มเติม
http://anounceprojectcpre55.blogspot.com/2016/01/django-cms-5-integrating-thied-party.html
5.ทำการทดลองใช้ video steaming
รายละเอียดเพิ่มเติม
http://anounceprojectcpre55.blogspot.com/2016/02/video-steamming.html
6.ค้นหาการวิจัยเกี่ยวกับการอ่านตัวอักษรวิ่งของมนุษย์
รายละเอียดเพิ่มเติม
http://anounceprojectcpre55.blogspot.com/2016/02/blog-post.html
วันพุธที่ 2 มีนาคม พ.ศ. 2559
Adviser meeting 3/03/2559
สิ่งที่ดำเนินการไปแล้ว1. ทดลองสร้างฟังก์ชัน upload file ขึ้นฐานข้อมูลใน django แต่ยังไม่สำเร็จ
2. วิเคราะห์/สรุป ความคืบหน้าของโปรเจคตั้งแต่ต้นปี พ.ศ. 2559
ปัญหาที่พบ
1. ไฟล์ที่ upload ไม่ถูกบันทึกลงฐานข้อมูล สัณนิฐานว่าเกิดจากฟังก์ชันส่งไฟล์ไป upload มีบางส่วนยังใช้คำสั่งไม่ถูก
สิ่งที่จะดำเนินการต่อไป
1. สร้างฟังก์ชัน upload file ต่อ
2. สร้างฟังก์ชันจัดการเวลาของประกาศและแสดงบนหน้าเว็บ
3. สร้างฟังก์ชันโพสข้อความมาแสดงยังหน้าเว็บ
4. เพิ่มรายละเอียด ความคืบหน้าของโปรเจค ให้สามารถเข้าใจความคืบหน้าและการทดลองที่ได้ทำไปได้อย่างคร่าวๆ
5. ทำวิดีโอแนะนำความคืบหน้าของโปรเจค (สัปดาห์ สอบตรง)
สมัครสมาชิก:
บทความ
(
Atom
)


