Merge lp:~james-w/udd/multi-db into lp:udd

Proposed by James Westby
Status: Work in progress
Proposed branch: lp:~james-w/udd/multi-db
Merge into: lp:udd
Prerequisite: lp:~james-w/udd/management-commands
Diff against target: 48 lines (+26/-6)
1 file modified
django_project/settings.py (+26/-6)
To merge this branch: bzr merge lp:~james-w/udd/multi-db
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Review via email: mp+85725@code.launchpad.net

Description of the change

Hi,

This configures django to have multiple dbs, using the same files
as the existing db files.

There will be no behaviour change here, it's just setting up the
aliases for later use.

Thanks,

James

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) :
review: Approve

Unmerged revisions

565. By James Westby

Merged management-commands into multi-db.

564. By James Westby

Turns out that django requires a default db, contrary to the docs.

563. By James Westby

Dont use the deleted paths module.

562. By James Westby

Don't have a default db so that every access has to be qualified.

561. By James Westby

Merged management-commands into multi-db.

560. By James Westby

Define the different databases.

559. By James Westby

Move the deletion of revids in to another script.

It's import-package specific, so it doesn't really belong in the
requeue script.

558. By James Westby

Add management commands for the things that touch the db.

557. By James Westby

Drop it from the crontab too.

556. By James Westby

Drop email_failures as it isn't used.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_project/settings.py'
2--- django_project/settings.py 2011-12-14 19:02:23 +0000
3+++ django_project/settings.py 2011-12-14 19:02:23 +0000
4@@ -1,5 +1,9 @@
5 # Django settings for django_project project.
6
7+from udd import iconfig
8+
9+udd_conf = iconfig.ImporterStack()
10+
11 DEBUG = True
12 TEMPLATE_DEBUG = DEBUG
13
14@@ -12,12 +16,28 @@
15 DATABASES = {
16 'default': {
17 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
18- 'NAME': 'udd.db', # Or path to database file if using sqlite3.
19- 'USER': '', # Not used with sqlite3.
20- 'PASSWORD': '', # Not used with sqlite3.
21- 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
22- 'PORT': '', # Set to empty string for default. Not used with sqlite3.
23- }
24+ 'NAME': udd_conf.get('pi.sqlite_file'), # Or path to database file if using sqlite3.
25+ 'USER': '', # Not used with sqlite3.
26+ 'PASSWORD': '', # Not used with sqlite3.
27+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
28+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
29+ },
30+ 'packages': {
31+ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
32+ 'NAME': udd_conf.get('pi.sqlite_package_file'), # Or path to database file if using sqlite3.
33+ 'USER': '', # Not used with sqlite3.
34+ 'PASSWORD': '', # Not used with sqlite3.
35+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
36+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
37+ },
38+ 'history': {
39+ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
40+ 'NAME': udd_conf.get('pi.sqlite_history_file'), # Or path to database file if using sqlite3.
41+ 'USER': '', # Not used with sqlite3.
42+ 'PASSWORD': '', # Not used with sqlite3.
43+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
44+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
45+ },
46 }
47
48 # Local time zone for this installation. Choices can be found here:

Subscribers

People subscribed via source and target branches