This project requires Python 3 and PostgreSQL:
$ sudo apt-get install python3-dev libpq-dev postgresql postgresql-contrib
First, setup a Python 3 virtual environment. The simple way:
$ virtualenv -p $(which python3) ../../venv
$ . ../../venv/bin/activate
Install Python dependencies (in a virtualenv preferably):
$ pip install -r requirements.txt
Every time you use the manage.py
server you'll need to make sure you're in the virtual environment:
$ . ../../venv/bin/activate
This project uses environment variables for configuration.
ECHONEST_API_KEY
: Credentials for The Echo Nest APIJAMENDO_CLIENT_ID
: Credentials for Jamendo APIFMA_API_KEY
: Credentials for FreeMusicArchive APISECRET_KEY
: Secret key for cryptographic signingDATABASE_URL
: URL for database connection (see database URL schema)
If you don't want to setup Postgres, set DATABASE_URL
to sqlite:///freemusicninja.db
To initialize or update the database:
./manage.py migrate
To create a new super user:
./manage.py createsuperuser
There are database fixtures for artist data provided in a submodule.
To update the fixtures submodule:
$ git submodule update --init
To install the fixture data:
$ ./manage.py loaddata artist fmaartist jamendoartist magnatuneartist
To start the Django server:
$ ./manage.py runserver 3200
Now visit http://localhost:3200/ in your browser.
There is a deploy task in the Fabric file. Unfortunately Fabric currently requires Python 2 so you'll need to install and use it in a Python 2 environment.
$ fab deploy