Commit e941164c authored by Georgios Gousios's avatar Georgios Gousios
Browse files

File name renames as per refs #323

parent d9f28c0a
*** SQLite
Django configuration in ettings.py:
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
DATABASES = {
'default': {
'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
# ATTENTION: This *must* be the absolute path if using sqlite3.
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name
'NAME': PROJECT_PATH + 'database.sqlite' # Or path to database file if using sqlite3.
}
}
Database initialization:
[the following commands assume the DB is at "./database.sqlite"]
recreate db, load db/fixtures/initial_data.json:
$ rm database.sqlite
$ bin/python manage.py syncdb
load fixtures, as necessary [take a look under db/fixtures/]:
$ bin/python manage.py loaddata db/fixtures/flavors.json
$ bin/python manage.py loaddata db/fixtures/vms.json
...
*** MySQL
Django configuration in settings.py:
DATABASES = {
'default': {
'ENGINE': 'mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
# ATTENTION: This *must* be the absolute path if using sqlite3.
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name
'NAME': 'synnefo', # Or path to database file if using sqlite3.
'USER': 'USERNAME', # Not used with sqlite3.
'PASSWORD': 'PASSWORD', # Not used with sqlite3.
'HOST': 'HOST', # Set to empty string for localhost. Not used with sqlite3.
'PORT': 'PORT', # Set to empty string for default. Not used with sqlite3.
# Have MySQL use InnoDB as the storage engine for newly created tables
'OPTIONS': {
'init_command': 'SET storage_engine=INNODB',
}
}
}
Server setup [not necessary for client operation]:
a) Install MySQL server, set password for user 'root'
b) Modify /etc/mysql/my.cnf to bind on public IP if you want to allow
allow connections from foreign hosts.
c) Create database:
$ mysql -u root -p
mysql> create database synnefo;
mysql> show databases;
mysql> GRANT ALL on synnefo.* TO username IDENTIFIED BY 'password';
Client setup:
d) Install the MySQL client
# apt-get install libmysqlclient-dev
$ bin/pip install MySQL-python
libmysqlclient-dev provides mysql_config, otherwise installing MySQL-python fails with:
EnvironmentError: mysql_config not found
*** PostgreSQL
Django configuration in settings.py:
DATABASES = {
'default': {
'ENGINE': 'postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
# ATTENTION: This *must* be the absolute path if using sqlite3.
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name
'NAME': 'DATABASE', # Or path to database file if using sqlite3.
'USER': 'USERNAME', # Not used with sqlite3.
'PASSWORD': 'PASSWORD', # Not used with sqlite3.
'HOST': 'HOST', # Set to empty string for localhost. Not used with sqlite3.
'PORT': 'PORT', # Set to empty string for default. Not used with sqlite3.
}
}
Client setup:
# apt-get install postgresql-client-8.4
attempt a connection:
$ psql -h HOST -p PORT -U USERNAME
# apt-get install libpq-dev
$ bin/pip install psycopg2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment