Skip to content
Tom Purucker edited this page Nov 9, 2017 · 1 revision

REST services

This page will contain a description of all the major components of the web page and batch processing capabilities. REST service document

Database architecture

The database architecture for QED is a shared database at the default level. If a database is needed within an individual application, such as hem_app, it will get its own database. This is outlined in the settings.py Example with SQLite:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(PROJECT_ROOT, 'db.sqlite3'),
    },
    'hem_db': {
       'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(PROJECT_ROOT, 'hem_app/hem_db.sqlite3'),
   }
}

DATABASE_ROUTERS = {'routers.HemRouter'}

Example with MySQL:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'dev_qed',
        'USER': 'app_hem',
        'PASSWORD': 'somepassword',
        'HOST': 'amad5.rtpnc.epa.gov',
        'PORT': '3306'
    },
    'hem_db': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'dev_hem',
        'USER': 'app_hem',
        'PASSWORD': 'somepassword',
        'HOST': 'amad5.rtpnc.epa.gov',
        'PORT': '3306'
    },
}

An example might be to have a settings_local.py with reference to a local SQLite database and a MySQL referenced in the settings.py for in production