#UDJ
UDJ is a social music player. It allows many people to control a single music player democratically. Checkout the UDJ homepage for more information. This is the official UDJ server. For details on the API for interacting with this server checkout the UDJ-0.6 REST API. You can also checkout the source for any of our several clients:
The udj server requires several python packages. They can
be found in requirements.txt
and installed with the command
pip install -r requirements.txt
It is suggested that before executing the above command you first setup a virtual environment in which to work. This will greatly help in preventing and conflicts you may have between any currently installed python packages and the ones required by UDJ. For more information about virtual environment, please visit the virtualenv homepage.
Also note that UDJ uses geodjango so you'll need to have a spatial database. For more information on setting up a spatial database and getting it working with geodjango, please view the geodjango documentation. We recommend setting up a PostGIS database, however UDJ should work in theory with other spatial databases supported by geodjango.
In order to run the test server, there are several key variables
that you must provide to the settings.py
file. This can easily be
done by creating a file called settings_local.py
. The settings.py
file will load this file and use any variables put in it. A
skeleton of what a typical settings_local.py
looks like can be found in
settings_local.skel
. Once you have all your settings configured,
you can populate your database with test data by executing
python manage.py loaddata udj/fixtures/test_fixture.json
This populates the database with dummy data and creates an
admin user with the username admin
and the password udj
.
Once you have everything setup, you can run the server by running the following command:
python manage.py runserver
- First install virtualenv, postgres, postgis, and python-dev.
sudo apt-get install python-virtualenv postgresql-9.1-postgis postgresql-server-dev-9.1 python-dev
- Next clone the Server Repository. For example:
clone https://github.com/klnusbaum/UDJ-Server.git
- Move into the server directory:
cd UDJ-Server
- Create the Virtual Environment that we're going to user:
virtualenv --distribute venv
- Activate the Virtual Environment:
source venv/bin/activate
- Install the necessary python packages:
pip install -r requirements.txt
pip install psycopg2==2.4.5
- Login as the postgres User:
sudo su - postgres
- Setup PostGIS by running the following commands:
POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-1.5
createdb -E UTF8 template_postgis
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
- Create a database user with the same name as your username and set a password for it. For example, if you were currently logged in as the user
steve
you'd run:
createuser --createdb steve
psql
alter user steve with password 'django';
- Exit the postgres user
exit
- Create the UDJ database from the postgis template:
createdb -T template_postgis UDJ
- Copy the skeleton local settings to your own version of the local settings:
cd udjserver
cp settings_local.skel settings_local.py
- Open up settings_local in your favorite text editor. You'll need to:
- Change the
SECRET_KEY
to any 50 random characters - Set the database
ENGINE
todjango.contrib.gis.db.backends.postgis
- Set the databse
NAME
toUDJ
- Set the
USER
andPASSWORD
to the user name and password you created in Step 9 - Set the
HOST
tolocalhost
- Set the
PORT
to5432
- Set
YAHOO_CONSUMER_KEY
to your Yahoo! BOSS API Consumer Key - Set
YAHOO_CONSUMER_SECRET
to your Yahoo! BOSS API Consumer Secret - Set
RDIO_CONSUMER_KEY
to your Rdio consumer key - Set
RDIO_CONSUMER_SECRET
to your Rdio consumer secret
- Sync the database:
./manage.py syncdb
- Migrate the database:
./manage.py migrate UDJ
- Finally, you can run the server with:
./manage.py runserver
UDJ is a team effort lead by Kurtis Nusbaum. I really like computers and programming.
If you have any questions or comments, please join us in the #udj irc channel in irc.freenode.net
UDJ is licensed under the GPLv2.