Site Network:

Setting Up Your Database

1. Create the database

First you'll want to create the database on a database server of your choice. In addition to that, it's a good idea to create a user for that database. Write down these settings as you'll need them later in the configuration file.

Note: If you're using SQLite, you don't need to create the file, the database setup will do that for you.

2. Database configuration

Setting up SQLite

For SQLite, set the database details to look like this:

sqlalchemy.url = sqlite:///%(here)s/database.sqlite

Setting up MySQL

For MySQL, change the configuration file to use these lines:

sqlalchemy.url = mysql://username:password@host:port/database
sqlalchemy.pool_recycle = 3600
sqlalchemy.convert_unicode = True

Setting up PostgreSQL

For PostgreSQL, use the following configuration string:

sqlalchemy.url = postgres://username:password@host:port/database

3. Setting up the database

To create all the tables in the database and prepopulate the database with some initial data, run the following command:

paster setup-app config.ini