pandora/README

108 lines
3 KiB
Text
Raw Normal View History

pan.do/ra - open media archive
== SETUP ==
To setup pan.do/ra, you need
python, bazaar, pip and virtualenv and several other python modules:
* Packages
apt-get install bzr git subversion mercurial \
python-setuptools python-pip python-virtualenv ipython \
2011-12-03 16:17:07 +00:00
python-dev python-imaging python-numpy python-psycopg2 \
python-geoip
2009-12-31 15:04:32 +00:00
* Pan.do/ra
Get code from bazzar
2010-07-03 11:14:16 +00:00
bzr branch http://code.0x2620.org/pandora pandora
cd pandora
2009-12-31 15:04:32 +00:00
virtualenv .
pip -E . install -r requirements.txt
cd static
bzr branch http://code.0x2620.org/oxjs
2009-12-31 15:04:32 +00:00
create settings_local.py and create site.jsonc
(use settings.py / 0xdb.jsonc / padma.jsonc as example)
create db
./manage.py syncdb
create / update static files
./manage.py update_static
./manage.py compile_pyc
* Additional pandora tools:
You need current versions of oxframe, oxtimeline installed.
For Ubuntu we provide these packages in a ppa:
apt-get install python-software-properties
add-apt-repository ppa:j/pandora
apt-get update
apt-get install oxframe oxtimeline
2009-12-31 15:04:32 +00:00
* Database
We use postgresql but other databases might also work
(make sure you have the python bindings installed).
2009-12-31 15:04:32 +00:00
create a postgresql database and adjust settings in local_settings.py
and run ./manage.py syncdb to populate the database.
2009-12-31 15:04:32 +00:00
2011-10-11 18:18:56 +00:00
createdb -T template0 --locale=C --encoding=UTF8 -O pandora pandora
2011-10-11 17:44:45 +00:00
(setting locale to C is required to fix a bug in sort if set to UTF8)
* RabbitMQ
For background tasks we use RabbitMQ, to install rabbitmq:
2009-12-31 15:04:32 +00:00
sudo apt-get install rabbitmq-server
and create permissions according to BROKER_* in local_settings.py i.e.:
2010-06-25 11:53:57 +00:00
sudo rabbitmqctl add_user pandora box
sudo rabbitmqctl add_vhost /pandora
2010-06-25 11:53:57 +00:00
sudo rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"
2009-12-31 15:04:32 +00:00
* H264
to support h264 videos, install ffmpeg with x264 enabled,
install qt-faststart from (ffmpeg/tools)
to enable add "mp4" to video.formats in your config.jsonc
2009-12-31 15:04:32 +00:00
Running developer environment:
in one terminal:
2010-12-24 10:31:44 +00:00
./manage.py runserver
and in another one:
./manage.py celeryd -Q default,encoding -B
2010-12-24 10:31:44 +00:00
=== Updating ===
To update a pandora installation get the latest version from bzr by running
./update.sh
this will pull pandora/oxjs/python-ox and list possible upgrades to the db
to update your database tables, use
./manage.py sqldiff -a
to check if there are changes and
./manage.py sqldiff -a | ./manage.py dbshell
to apply them.
== DEPLOYMENT ==
* Install upstart scripts
check etc/init for upstart scripts, adjust path and user and put into /etc/init
To run pan.do/ra in production, we use nginx, using apache2 is also possible.
* nginx setup
sudo apt-get install nginx
add this to local_settings.py:
XACCELREDIRECT = True
setup nginx according to etc/nginx/vhost.in
* apache2 setup
apt-get install apache2-mpm-prefork libapache2-mod-xsendfile
add this to local_settings.py:
XSENDFILE = True
2010-09-07 13:08:23 +00:00
setup apache according to etc/apache2/vhost.in
2010-12-24 10:31:44 +00:00