Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bernardopires/django-tenant-schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardopires committed Jul 30, 2015
2 parents dee48dc + a848b54 commit 43fde4c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ that you read the complete version at

Your ``DATABASE_ENGINE`` setting needs to be changed to

::
.. code-block:: python
DATABASES = {
'default': {
Expand All @@ -119,7 +119,7 @@ Add the middleware ``tenant_schemas.middleware.TenantMiddleware`` to the
top of ``MIDDLEWARE_CLASSES``, so that each request can be set to use
the correct schema.

::
.. code-block:: python
MIDDLEWARE_CLASSES = (
'tenant_schemas.middleware.TenantMiddleware',
Expand All @@ -130,7 +130,7 @@ Add ``tenant_schemas.routers.TenantSyncRouter`` to your `DATABASE_ROUTERS`
setting, so that the correct apps can be synced, depending on what's
being synced (shared or tenant).

::
.. code-block:: python
DATABASE_ROUTERS = (
'tenant_schemas.routers.TenantSyncRouter',
Expand All @@ -141,7 +141,7 @@ Add ``tenant_schemas`` to your ``INSTALLED_APPS``.
Create your tenant model
~~~~~~~~~~~~~~~~~~~~~~~~

::
.. code-block:: python
from django.db import models
from tenant_schemas.models import TenantMixin
Expand All @@ -156,7 +156,7 @@ Define on ``settings.py`` which model is your tenant model. Assuming you
created ``Client`` inside an app named ``customers``, your
``TENANT_MODEL`` should look like this:

::
.. code-block:: python
TENANT_MODEL = "customers.Client" # app.Model
Expand All @@ -170,7 +170,7 @@ schema.
Create your tenants just like a normal django model. Calling ``save``
will automatically create and sync the schema.

::
.. code-block:: python
from customers.models import Client
Expand Down Expand Up @@ -201,9 +201,9 @@ tenant specific apps. Complete instructions can be found at
.. _PostgreSQL’s official documentation on schemas: http://www.postgresql.org/docs/9.1/static/ddl-schemas.html
.. _Multi-Tenant Data Architecture: http://msdn.microsoft.com/en-us/library/aa479086.aspx

.. |PyPi version| image:: https://pypip.in/v/django-tenant-schemas/badge.png
:target: https://crate.io/packages/django-tenant-schemas/
.. |PyPi downloads| image:: https://pypip.in/d/django-tenant-schemas/badge.png
:target: https://crate.io/packages/django-tenant-schemas/
.. |PyPi version| image:: https://img.shields.io/pypi/v/django-tenant-schemas.svg
:target: https://pypi.python.org/pypi/django-tenant-schemas
.. |PyPi downloads| image:: https://img.shields.io/pypi/dm/django-tenant-schemas.svg
:target: https://pypi.python.org/pypi/django-tenant-schemas
.. _setup: https://django-tenant-schemas.readthedocs.org/en/latest/install.html
.. _django-tenant-schemas.readthedocs.org: https://django-tenant-schemas.readthedocs.org/en/latest/

0 comments on commit 43fde4c

Please sign in to comment.