2013년 7월 25일 목요일

uwsgi stop

http://uwsgi-docs.readthedocs.org/en/latest/Management.html
uwsgi --stop /tmp/project-master.pid

flask + uwsgi + nginx

uwsgi.ini
[uwsgi]
pythonpath = /Library/Python/2.7/site-packages
env = APPLICATION_SETTINGS= ...

uwsgi 실행
uwsgi uwsgi.ini -s uwsgi/uwsgi.sock -w main:app> flask.log


include uwsgi_params;
uwsgi_pass unix: /tmp/uwsgi.sock;


nginx 실행


2013년 7월 16일 화요일

emacs + python에서 auto indent

(add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-m" 'newline-and-indent)))

emacs python할때 현재 폴더에 있는 모듈을 불러오지 못할때.

http://stackoverflow.com/questions/2658475/python-mode-import-problem

.emace.d/init.el에

(defun python-reinstate-current-directory ()
  "When running Python, add the current directory ('') to the head of sys.path.
For reasons unexplained, run-python passes arguments to the
interpreter that explicitly remove '' from sys.path. This means
that, for example, using `python-send-buffer' in a buffer
visiting a module's code will fail to find other modules in the
same directory.

Adding this function to `inferior-python-mode-hook' reinstates
the current directory in Python's search path."
  (python-send-string "sys.path[0:0] = ['']"))

(add-hook 'inferior-python-mode-hook 'python-reinstate-current-directory)

위와 같이 추가

2013년 6월 12일 수요일

jython setting

#!/bin/bash
.  /Users/skplanet/TOOL/grinder-3.11/bin/setGrinderEnv.sh

for jarfile in `ls $GRINDERPATH/lib/*.jar`; do
    CLASSPATH="$jarfile:$CLASSPATH"
done

export CLASSPATH

java -classpath $CLASSPATH  org.python.util.jython $1