Skip to content

FreeMusicNinja/api.freemusic.ninja

Repository files navigation

Free Music Ninja API

https://circleci.com/gh/FreeMusicNinja/api.freemusic.ninja.png?style=badge https://codecov.io/github/FreeMusicNinja/api.freemusic.ninja/coverage.svg?branch=master

Requirements

This project requires Python 3 and PostgreSQL:

$ sudo apt-get install python3-dev libpq-dev postgresql postgresql-contrib

Installation

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

Environment Variables

This project uses environment variables for configuration.

  1. ECHONEST_API_KEY: Credentials for The Echo Nest API
  2. JAMENDO_CLIENT_ID: Credentials for Jamendo API
  3. FMA_API_KEY: Credentials for FreeMusicArchive API
  4. SECRET_KEY: Secret key for cryptographic signing
  5. DATABASE_URL: URL for database connection (see database URL schema)

If you don't want to setup Postgres, set DATABASE_URL to sqlite:///freemusicninja.db

Database Migrations

To initialize or update the database:

./manage.py migrate

To create a new super user:

./manage.py createsuperuser

Fixtures

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

Running the Server

To start the Django server:

$ ./manage.py runserver 3200

Now visit http://localhost:3200/ in your browser.

Deployment

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

About

Django-powered API for Free Music Ninja

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages