[blipit] r164 committed - Adding the requirements and INSTALL instructions

0 views
Skip to first unread message

bli...@googlecode.com

unread,
Jan 16, 2011, 3:54:29 AM1/16/11
to bli...@googlegroups.com
Revision: 164
Author: dipt...@gmail.com
Date: Sun Jan 16 00:53:32 2011
Log: Adding the requirements and INSTALL instructions
http://code.google.com/p/blipit/source/detail?r=164

Added:
/trunk/blipitsms/README
/trunk/blipitsms/requirements.txt
Modified:
/trunk/blipitsms/geocoder/app.py
/trunk/blipitsms/geocoder/blip.py
/trunk/blipitsms/geocoder/tasks.py

=======================================
--- /dev/null
+++ /trunk/blipitsms/README Sun Jan 16 00:53:32 2011
@@ -0,0 +1,72 @@
+Welcome to BlipitSMS
+
+INSTALL
+
+Requirements
+* Python 2.6
+* Virtualenv
+* pip
+* RapidSMS
+* celery
+* django-celery
+* RabbitMQ
+
+Step 1
+Download and install RabitMQ, if you are on OSX use homebrew (brew install
rabbitmq)
+
+a. Start the RabbitMQ server by -
+ sudo rabbitmq-server
+
+b. See the status -
+ sudo rabbitmqctl status
+ Status of node 'rabbit@Diptanu-Choudhurys-MacBook-Pro' ...
+ [{running_applications,[{rabbit,"RabbitMQ","2.2.0"},
+ {os_mon,"CPO CXC 138 46","2.2.5"},
+ {sasl,"SASL CXC 138 11","2.1.9.2"},
+ {mnesia,"MNESIA CXC 138 12","4.4.16"},
+ {stdlib,"ERTS CXC 138 10","1.17.2"},
+ {kernel,"ERTS CXC 138 10","2.14.2"}]},
+ {nodes,[{disc,['rabbit@Diptanu-Choudhurys-MacBook-Pro']}]},
+ {running_nodes,['rabbit@Diptanu-Choudhurys-MacBook-Pro']}]
+ ...done.
+
+ Note the hostname of the node, in this case it is
Diptanu-Choudhurys-MacBook-Pro.local
+
+c. Add a user
+ sudo rabbitmqctl add_user myuser mypassword
+
+d. Add vhost
+ rabbitmqctl add_vhost myvhost
+
+e. rabbitmqctl set_permissions -p myvhost myuser ".*" ".*" ".*"
+
+f. Add the relevant details in settings.py of blipitsms
+
+BROKER_HOST = "Diptanu-Choudhurys-MacBook-Pro.local"
+BROKER_PORT = 5672
+BROKER_USER = "diptanuc"
+BROKER_PASSWORD = "test123"
+BROKER_VHOST = "blipit"
+
+Step 2
+
+Create a virtualenv with the following command -
+virtualenv blipitenv --no-site-packages
+
+Step 3
+
+Install pip
+sudo easy_intsall pip
+
+Step 4
+
+Install the dependencies of blipitsms using pip
+
+pip install -r requirements.txt
+
+Step 5
+
+Activate the virtualenv
+
+source path/to/blipitenv/bin/activate
+
=======================================
--- /dev/null
+++ /trunk/blipitsms/requirements.txt Sun Jan 16 00:53:32 2011
@@ -0,0 +1,16 @@
+Django==1.2.4
+RapidSMS==0.9.6a
+amqplib==0.6.1
+anyjson==0.3
+carrot==0.10.7
+celery==2.1.4
+django-celery==2.1.4
+django-nose==0.1.2
+django-picklefield==0.1.9
+djappsettings==0.1.0
+djtables==0.1.1
+importlib==1.0.2
+nose==1.0.0
+pyparsing==1.5.5
+python-dateutil==1.5
+wsgiref==0.1.2
=======================================
--- /trunk/blipitsms/geocoder/app.py Sun Jan 16 00:02:33 2011
+++ /trunk/blipitsms/geocoder/app.py Sun Jan 16 00:53:32 2011
@@ -7,16 +7,13 @@

def parse(self, msg):
msg_txt = (msg.text).strip().split(" ",1)
- print msg_txt
channels = Channel.objects.filter(channel_name = msg_txt[0])
- print channels
channel_list = []
for channel in channels:
channel_list.append(blip.Channel(channel.channel_id))

- print channel_list
if len(channel_list) is not 0:
- tasks.send(msg.connection.identity, msg_txt[1], channel_list,
msg)
+ tasks.send(msg.connection.identity,
msg_txt[1].replace(","," "), channel_list, msg)
msg.respond("We are processing your request")
return

=======================================
--- /trunk/blipitsms/geocoder/blip.py Sat Jan 15 23:53:11 2011
+++ /trunk/blipitsms/geocoder/blip.py Sun Jan 16 00:53:32 2011
@@ -29,6 +29,6 @@

def post(self):
json_data = json.dumps(self.blip)
- request = urllib2.Request(self.url, json_data)
- response = urllib2.urlopen(request)
+ request = urllib2.Request(self.url, json_data)
+ response = urllib2.urlopen(request)
return
=======================================
--- /trunk/blipitsms/geocoder/tasks.py Sat Jan 15 23:53:11 2011
+++ /trunk/blipitsms/geocoder/tasks.py Sun Jan 16 00:53:32 2011
@@ -22,7 +22,6 @@
url_request = urllib2.urlopen(url)
response = url_request.read()
geocoder_result = json.loads(response)
- print msg
if geocoder_result['status'] == u'OK':
latitude =
geocoder_result['results'][0]['geometry']['location']['lat']
longitude =
geocoder_result['results'][0]['geometry']['location']['lng']

Reply all
Reply to author
Forward
0 new messages