Skip to content

Running the Project

fxh32 edited this page Oct 21, 2011 · 5 revisions

Once the Dependencies have been installed, the project needs a few more steps before it's ready to run.

Configuration

First you need to create a configuration file called config.py in the root directory of the project. This file is just a Python script and needs several variables filled out.

SESSION_SALT - Used to salt the encrypted session information by Flask. Should probably not be a configuration option for much longer.

SQLALCHEMY_DATABASE_URI - The location of the SQLite database to be used. If you're having trouble, try touching the file first.

Here's my sample configuration file:

# configuration
SESSION_SALT = 'DEVKEY'
SQLALCHEMY_DATABASE_URI = 'sqlite:///../tmp/test.db'
DEBUG = False

LASTFM_API_KEY = '295e485894bdf30203b53607f1d94e34'
LASTFM_API_SECRET = ''

# Can be "builtin" or "tornado"
SERVER = "builtin"

SERVER_HOST = '127.0.0.1'
SERVER_PORT = 5000

mpd_local = '192.168.69.128'
mpd_home = 'partify.local'

MPD_SERVER = {'host': mpd_local, 'port': 6600}

SECRET_KEY = 'devkey'

Make sure you have a directory in which to put your database file (eg. if you use this file don't forget to mkdir tmp! The gitignore with this project is set to ignore the tmp directory so that's probably the best place to put the database file.

Set up the database

As easy as python partify/database.py. That file also has some functions that you can run from ipython or another REPL to clear and initialize the db.

Build the Javascript

The Javascript that runs in the browser is not included in the repository by default because it is compiled to from a language called Coffeescript. Issue the command make to compile the packaged Coffeescript into Javascript, which is suitable to be interpreted by the browser.

Run the project!

When you have the configuration file and database created, you can run the project by running run.py in a Python interpreter, i.e. python run.py. The application will start the development server listening on localhost at port 5000.

Clone this wiki locally