Metadata-Version: 2.1
Name: django-database-for-apps
Version: 0.1.0
Summary: Django router for apps with more than 1 database
Home-page: https://github.com/dex4er/django-database-for-apps
Author: Piotr Roszatycki
Author-email: piotr.roszatycki@gmail.com
License: LGPL
Keywords: django migration migrate model
Platform: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Classifier: Framework :: Django :: 2.0
Classifier: Framework :: Django :: 2.1
Classifier: Framework :: Django :: 2.2
Requires-Dist: django (<2) ; python_version < "3"
Requires-Dist: django (>=2) ; python_version >= "3"
Provides-Extra: dev
Requires-Dist: docutils ; extra == 'dev'
Requires-Dist: Pygments ; extra == 'dev'

.. image:: https://img.shields.io/pypi/v/django-database-for-apps.svg
   :target: https://pypi.python.org/pypi/django-database-for-apps
.. image:: https://travis-ci.org/dex4er/django-database-for-apps.svg?branch=master
   :target: https://travis-ci.org/dex4er/django-database-for-apps
.. image:: https://readthedocs.org/projects/django-database-for-apps/badge/?version=latest
   :target: http://django-database-for-apps.readthedocs.org/en/latest/
.. image:: https://img.shields.io/pypi/pyversions/django-database-for-apps.svg
   :target: https://www.python.org/
.. image:: https://img.shields.io/pypi/djversions/django-database-for-apps.svg
   :target: https://www.djangoproject.com/

django-database-for-apps
========================

``django-database-for-apps`` is a package that provides a router which chooses
a database based on app name.


Installation
------------

Install with ``pip`` or ``pipenv``:

.. code:: python

  pip install django-database-for-apps

Add ``django_database_for_apps`` to your installed apps in your
settings.py file:

.. code:: python

  INSTALLED_APPS = [
      'django_database_for_apps',
      ...
  ]


Configuration
-------------

.. code:: python

  # list of apps and theirs database
  DATABASE_FOR_APPS = {
      'test_project': 'default',
      '*': 'django',
  }

``*`` matches all applications so the default database might be redefined from
``'default'`` to something else.

Optional
^^^^^^^^

.. code:: python

  # allows relations between databases (default: None)
  DATABASE_FOR_APPS_RELATIONS = True


Documentation
-------------

See http://django-database-for-apps.readthedocs.org/


License
-------

Copyright © 2019, Piotr Roszatycki

This software is distributed under the GNU Lesser General Public License (LGPL
3 or greater).


