• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

About me

Let me introduce myself


A bit about me

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

I have more than 5 years’ experience related to manufacturing of optical design ,Camera Module and also have some experience on coding . Having years of RD experience that cooperated with international ODM/OEM partners and optics-mechanical products development/DataAnalysis/research/process.

Profile

Deepak Bhagya

Personal info

Deepak Bhagya

If I have seen further than others, it is by standing upon the shoulders of giants.

Birthday: 21 Dec 1984
Phone number: +886
Website: https://bobobo746.blogspot.com
E-mail: 2dkjd1k@gmail.com

RESUME

Know more about my past


Employment

  • 2016-future

    https://www.ixensor.com/ix_web/ @ Optical-Software Programmer

    Optical-Signal algorithm and analysis: 1). Using smart phone’s front camera as optical-analysis device to observe color signal change. 2). Color signal change is based on the blood reacts with strips. 3.) By those signal change, trying to figure out a curve line to represent the bio-reacts on strips and use those feature to construct a measurement system. 4.) Trying to improve the bias, accuracy and precision. 5.) Issues fixed. Image process algorithm: 1.) Image Recognition: Analysis the image to make sure whether the optical device’s uniformity is qualified or not. Experiment Data Build: 1.) Using SQL to build Database for Experiment data. 2.) Producing API for co-workers to access and get some data source, reducing the data collecting time. 3.) Maintaining data base and trying to improve data schemas.

  • 2013-2016

    http://www.primax.com.tw/ @ Sr.Optical and Software Engineer

    1). Camera lens optical specifications define and analysis optical issue, likes the Flare, MTF(SFR), Alignment, Optical Center, and NG-sample analysis. 3). Lens focusing image recognition: Programming an application for machine to recognize the image and focus lens. 4). Con-call and report to customer, and vendor management.

  • 2010-2013

    www.Ledlink.com @ Optical Engineer

    1/ LED lighting lens module development, LED module development of TV backlight, new module development and spec. define. 2/ Optical design of LED lighting lens, jigs design, and solve process problems. 3/ Precision process development, new film materials analysis. 4/ New patent application . 5/ Optical simulation analysis

Education

  • 2006-2009

    University of NCUE @ graduated

    bachelor of science (physics)

  • *********.

Skills & My Love

Engineer
80%
software
WorkOut
91%
Fitting
Coding
95%
Python

Portfolio

My latest projects


2018年4月29日 星期日

動力

動力

一年前架設部落格,本來想把所學記錄在此,後來發現bookstone等更好的筆記本 且又支持原生的markdown語法,漸漸的都變成用bookstone筆記本然後用google drive 將我在公司和家裡時候的筆記做sync,慢慢的就忘記去經營部落格。 最近打開來看瀏覽人數,竟也有人會來這裡找資料,因此只要我有在學習的一天,我會盡量把我的筆記轉載來這邊,分享給大家,也希望大家互助一起學習。共勉之。 p.s Software RD 真的很rice 大家都不藏私 ...也只有從別的RD身份轉過來的才能有此感觸

2018年4月9日 星期一

How to deploy a django project with Apache

How to deploy a django project with Apache

How to deploy a django project with Apache

參考連結:
How to deploy a django project with Apache ~ Innuy Developers Blog

超痛恨python的安裝,總是許多坑…這次django的伺服器架設也不例外。 網路上的資源一堆但是版本也是五花八門眼花撩亂(e04)。

以下是我自己安裝測試成功的解法:

步驟一 確認在虛擬環境下執行

裡面有安裝virtualenv方法:
macOS: Install OpenCV 3 and Python 2.7 - PyImageSearch

步驟二 apache安裝:

macos本身已有內建apache,不過版本是2.4,更新方式:

  • Updating Apache
    Mac OS X El Capitan and Mac OS X Sierra both come with Apache pre-installed. As noted above, your Apache configuration file is overwritten me when you upgrade to Mac OS X Sierra.
    There were a few differences in the configuration files. However, since both El Capitan and Sierra run Apache 2.4, you can simply backup the configuration file from Sierra and overwrite it with your El Capitan version:
12sudo cp /etc/apache/httpd.conf /etc/apache/httpd.conf.sierra
sudo mv /etc/apache/httpd.conf.pre-update /etc/apache/httpd.conf

啟動內建的Apache:

1234sudo apachectl start

# sudo apachectl stop  關閉
# sudo apachectl restart 重啟

步驟三 mod_wsgi 安裝:

1$ pip install mod_wsgi  

啟動:

12$ mod_wsgi-express start-server
# 跳出按control+c

步驟四 串起apache,Django,wsgi 關係:

  1. 先在django project裡面的setting.py 增加:
1234MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
  1. 再來在terminal執行:
1$ python manage.py collectstatic
  1. 讓apache認得wsgi 取得mod-wsgi安裝位置, 在terminal執行:
1$ mod_wsgi-express module-location

我這台電腦結果如下:

1/Users/bobobo746/.virtualenvs/cv3/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-darwin.so
  1. 再把結果貼到檔案路徑: /etc/apache2/httpd.conf.
    找到一堆 LoadModule 的地方,然後補上:
1LoadModule wsgi_module /Users/bobobo746/.virtualenvs/cv3/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-darwin.so
  1. 測試確認,在terminal 執行:
1$ apachectl -t -D DUMP_MODULES | grep wsgi

應出現: wsgi_module (shared)
但很有可能httpd.conf裡面沒有預先給定servernmame所以會報錯,如果報錯,則在httpd.conf裡面找到

1#ServerName www.example.com:80

下一行補上:

123ServerName 0.0.0.0  #不寫死localhost

# 如要改為對外,在這邊改對外ip
  1. 讓apache認得django httpd.conf最後一行有提到 Include /private/etc/apache2/other/*.conf 。要讓python的檔案能被讀到就要在other資料夾底下增加.conf檔案: (以下是我改好我的)
123456789101112131415161718WSGIScriptAlias / /Users/bobobo746/Desktop/stuff/python/Python3/U/U/wsgi.py

WSGIDaemonProcess example python-home=/Users/bobobo746/.virtualenvs/cv3/ python-path=/Users/bobobo746/Desktop/stuff/python/Python3/U
WSGIProcessGroup example


     
        Require all granted
     


   Alias "/static/" "/Users/bobobo746/Desktop/stuff/python/Python3/U/static"

   
     Require all granted
     Options +Indexes
   

註釋:

  • exmaple :變數名稱 可以更改
  • WSGIScriptAlias :專案裡 wsgi.py 的路徑
  • WSGIDaemonProcess : 虛擬環境的路徑 還有專案的路徑
  • <directory “專案路徑”>
  1. 最後串起來後測試看看:
1$ sudo apachectl restart
  1. 如果要改port,可以到httpd.conf 找到 :
12#Listen 12.34.56.78:80
Listen 80

改成自定義的port

  1. 回 django的 setting.py 做以下修正:
123DEBUG = False

ALLOWED_HOSTS = ["*",]
  1. 本機ip固定是127.0.0.1 ,所以測試時候去chrome打:
    127.0.0.1:8081/here (我在listen那邊修改了port為8081, 且我專案的連結在here會吐出字串)
  1. 測試成功 QQ 可以好好專注寫code了…

在其他方式測試時遇到問題:

  • 因為我在其他方式測試時雨到問題所以修改過權限,所以在這邊的方法就沒碰到,但有可能在此方法也會遇到permission的問題,可能是路徑的資料夾的權限要改為唯讀:
  1. 對資料夾按右鍵,選取得資訊
  2. 最下面,分享與權限,everyone要改為唯讀

Services

What can I do


Branding

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Web Design

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque.

Graphic Design

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Development

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Photography

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

User Experience

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com