- python 2.7
- django
- mongodb
- libmagic
If your OS is above MAC OS X 10.9, use the following command first:
$ export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
$ sudo apt-get install python-dev libxml2-dev libxslt-dev
$ git clone https://github.com/PwnDoRa/mazu
$ cd mazu
$ pip install -r requirements.txt
$ cp settings/production.example.py settings/production.py
Add a secret key in settings/production.py, like this:
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '^v_m6li36$7*px46xw$)a(^&8_)sdfakfjkagu12-8=239r823ls**'
$ cd mazu
$ ./manage.py syncdb
$ ./manage.py runserver 127.0.0.1:8000
-
start mongodb server first
-
start celery worker
$ ./manage.py celery worker --app mazu --beat
./manage.py shell
>>> from django.contrib.auth.models import User
>>> from authkey.models import AuthKey
>>> User.objects.create_user('username', 'username@example.com', 'password').save()
>>> usr = User.objects.get(username='username')
>>> AuthKey(owner=usr, ident='ident', secret='secret', pubchans='["chan1"]', subchans='["chan1"]').save()
vim broker/config.py
python broker/broker.py
git clone https://github.com/rep/hpfeeds
pip install gevent
cd hpfeeds/cli/
cp ../lib/hpfeeds.py ./
hpfeeds-client
Usage: hpfeeds-client -i ident -s secret --host host -p port -c channel1 [-c channel2, ...] <action> [<data>]
hpfeeds-client: error: You need to give "subscribe" or "publish" as <action>.
for example, publish a message on "chan1" can use command line like below:
./hpfeeds-client -i ident -s secret --host 127.0.0.1 -p 20000 -c chan1 publish "helloworld"
subscribe messages of "chan1" can use command line:
./hpfeeds-client -i ident -s secret --host 127.0.0.1 -p 20000 -c chan1 subscribe
- virtualenv
- virtualenvwrapper
- south
$ pip install virtualenv
$ pip install virtualenvwrapper
$ pip install south