From 9636d4a6767f49384d5c386bc3f1142c88b90613 Mon Sep 17 00:00:00 2001
From: Alvin Li <liweitianux@gmail.com>
Date: Tue, 13 Aug 2013 14:13:24 +0800
Subject: cloned from 'bitbucket', 2013/08/13

---
 97suifangqa/env/mk-virtual-env.py | 22 ++++++++++++++++++++++
 97suifangqa/env/requirements.pip  |  8 ++++++++
 97suifangqa/env/solr.sh           | 12 ++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100755 97suifangqa/env/mk-virtual-env.py
 create mode 100644 97suifangqa/env/requirements.pip
 create mode 100644 97suifangqa/env/solr.sh

(limited to '97suifangqa/env')

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
-- 
cgit v1.2.2