diff options
author | Alvin Li <liweitianux@gmail.com> | 2013-08-13 14:13:24 +0800 |
---|---|---|
committer | Alvin Li <liweitianux@gmail.com> | 2013-08-13 14:13:24 +0800 |
commit | 9636d4a6767f49384d5c386bc3f1142c88b90613 (patch) | |
tree | 3a70f6d9e4be1791d36c87cc7cbfd1d5aa2b39dd /97suifangqa/env | |
parent | 9383d9a8a5988d071766c3d08a5c946e9c5b02ae (diff) | |
download | 97dev-9636d4a6767f49384d5c386bc3f1142c88b90613.tar.bz2 |
cloned from 'bitbucket', 2013/08/13
Diffstat (limited to '97suifangqa/env')
-rwxr-xr-x | 97suifangqa/env/mk-virtual-env.py | 22 | ||||
-rw-r--r-- | 97suifangqa/env/requirements.pip | 8 | ||||
-rw-r--r-- | 97suifangqa/env/solr.sh | 12 |
3 files changed, 42 insertions, 0 deletions
diff --git a/97suifangqa/env/mk-virtual-env.py b/97suifangqa/env/mk-virtual-env.py new file mode 100755 index 0000000..be51dea --- /dev/null +++ b/97suifangqa/env/mk-virtual-env.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +#-*- coding: utf-8 -*- +''' + 用法: + 1. 安装:在mk-virtua-env.py文件所在目录下执行python mk-virtualenv-env.py以安装环境 + 2. 运行:在terminal里面执行source <PROJ-DIR>/env/env/bin/activate, 然后启动web服务相关的进程 +''' +import virtualenv, textwrap +import os,subprocess, tempfile +output = virtualenv.create_bootstrap_script(textwrap.dedent(""" +import os, subprocess +def after_install(options, home_dir): + subprocess.call([join(home_dir, 'bin', 'pip'), + 'install', + '-r', + 'requirements.pip']) +""")) +f = tempfile.NamedTemporaryFile() +f.write(output) +f.flush() + +subprocess.call(['python', f.name, 'env']) diff --git a/97suifangqa/env/requirements.pip b/97suifangqa/env/requirements.pip new file mode 100644 index 0000000..c362dad --- /dev/null +++ b/97suifangqa/env/requirements.pip @@ -0,0 +1,8 @@ +#-*- coding: utf-8 -*- +# 安装指定依赖的第三方库和版本:pip install -r requirements.pip +django < 1.5 +PIL +lxml +pysolr +uwsgi +git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack diff --git a/97suifangqa/env/solr.sh b/97suifangqa/env/solr.sh new file mode 100644 index 0000000..ec8d0e8 --- /dev/null +++ b/97suifangqa/env/solr.sh @@ -0,0 +1,12 @@ +wget http://mirror.bit.edu.cn/apache/lucene/solr/3.6.2/apache-solr-3.6.2.tgz -O solr.tgz +tar xzvf solr.tgz + +# 使用方法 +#生成schema.xml: + #./manage.py build_solr_schema > env/apache-solr-3.6.2/example/solr/conf/schema.xml + +#启动solr: + #java -jar env/apache-solr-3.6.2/example/start.jar + +#更新索引: + #./manage.py update_index |