项目作者: LalithaPrasad

项目描述 :
A small django app using multiple databases
高级语言: Python
项目地址: git://github.com/LalithaPrasad/ERMS_Django_Web_Multi_DB.git
创建时间: 2020-04-16T05:29:37Z
项目社区:https://github.com/LalithaPrasad/ERMS_Django_Web_Multi_DB

开源协议:

下载


This app is same in functionality as ERMS_Django_Web. But this app uses
multiple databases. I created this app because the django documentation on
using multiple databases is not clear. In addition to django’s default
database, it uses ‘admindb’ to store admin credentials, and ‘empdb’ to store
employee data. Go through the ‘settings.py’ for details about db configuration.
This app uses ‘dbrouter’ to direct the db actions to appropriate databases. It
is possible to not use ‘dbrouter’ and explicitly specify database for db
actions. See the django docmentation for that.

As usual, the project requirements are given in ‘ERMS.pdf’. Before running the
app, initialise and migrate the databases with the following commands:

  1. ./manage.py makemigrations app_django
  2. ./manage.py migrate --database=default
  3. ./manage.py migrate --database=admindata
  4. ./manage.py migrate --database=empdata
  5. ./manage.py migrate

‘admindata’ and ‘empdata’ are the names used in ‘settings.py’

Run the app with:

  1. ./manage.py runserver