Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
e941164c
Commit
e941164c
authored
Mar 30, 2011
by
Georgios Gousios
Browse files
File name renames as per refs #323
parent
d9f28c0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.DB
deleted
100644 → 0
View file @
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
DEPLOY.txt
→
README.deploy
View file @
e941164c
File moved
DEVELOP.txt
→
README.develop
View file @
e941164c
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment