Commit Graph

648 Commits

Author SHA1 Message Date
Bernardo Pires 94e8b6cde4 Merge pull request #466 from Viatrak/master
Added IDs to system checks. IDs can now be used in SILENCED_SYSTEM_CHECKS. Thanks @Viatrak
2017-04-23 23:03:42 +02:00
Bernardo Pires 9dd3858dae Merge pull request #452 from Jorl17/master
Added BaseTenantMiddleware for easier custom middleware support. Thanks @Jorl17.
2017-04-23 23:00:35 +02:00
Bernardo Pires a4fb6cd936 Merge pull request #454 from mcanaves/master
Added parallel migrations. Thank you @mcanaves
2017-04-23 22:53:23 +02:00
Mateu Cànaves 73fdfdff8e Resolved conflicts 2017-04-18 12:19:40 +02:00
Adnan Umer ab12904826 Migrated to TEMPLATES settings 2017-04-17 15:54:16 +05:00
Adnan Umer a21ed181fe Unit Tests for CachedLoader 2017-04-17 15:53:56 +05:00
Adnan Umer 8634634b1c Django 1.9 Support 2017-04-17 15:52:37 +05:00
Gary Reynolds 090f5b3ef7 Bump version: 1.7.0 → 1.8.0 2017-04-17 15:03:59 +05:00
Gary Reynolds 6b8d41469a Updates for Django 1.11 2017-04-17 15:03:59 +05:00
Stéphane Raimbault 6f6c871a0c Fix documentation about custom management commands (#464) 2017-04-17 15:03:59 +05:00
Stéphane Raimbault 36e1ba3800 Django 1.11 support (#463)
* Added Django 1.11 to Travis

- related to #435
- 😉 to tomturner/django-tenants#120

* Replace direct use of import_module by proper load_backend

Handle new 'django.db.backends.postgresql' name (Django 1.9)

* Fix 'default' already present in _fields in Django 1.11

* Fix not existing access to original_backend.DatabaseError (Django 1.11)

Removed exports because django.db.utils.DatabaseError and
django.db.utils.IntegrityError must be used instead.

This change must be stated in release notes.

* The signature of DatabaseWrapper._cursor has changed in Django 1.11

Use the public API

* Add missing allowed hosts for tests

* Don't override default user or blocks Unix socket DB connection

* Updated tox.ini for Django 1.11rc1

* Properly add '.test.com' to ALLOWED_HOSTS in test cases

* Internal tests don't use TenantTestCase so set allowed hosts manually

* Drop Django 1.9 support

Django 1.8 is still within LTS until the end of 2017.
2017-04-17 15:03:59 +05:00
Gary Reynolds 71019cded9 Bump version: 1.7.0 → 1.8.0 2017-04-16 22:57:06 +10:00
Gary Reynolds 42ef023436 Updates for Django 1.11 2017-04-16 22:35:33 +10:00
Stéphane Raimbault 8faa5a74bb Fix documentation about custom management commands (#464) 2017-04-12 15:08:55 +10:00
Stéphane Raimbault 1cb00dc6db Django 1.11 support (#463)
* Added Django 1.11 to Travis

- related to #435
- 😉 to tomturner/django-tenants#120

* Replace direct use of import_module by proper load_backend

Handle new 'django.db.backends.postgresql' name (Django 1.9)

* Fix 'default' already present in _fields in Django 1.11

* Fix not existing access to original_backend.DatabaseError (Django 1.11)

Removed exports because django.db.utils.DatabaseError and
django.db.utils.IntegrityError must be used instead.

This change must be stated in release notes.

* The signature of DatabaseWrapper._cursor has changed in Django 1.11

Use the public API

* Add missing allowed hosts for tests

* Don't override default user or blocks Unix socket DB connection

* Updated tox.ini for Django 1.11rc1

* Properly add '.test.com' to ALLOWED_HOSTS in test cases

* Internal tests don't use TenantTestCase so set allowed hosts manually

* Drop Django 1.9 support

Django 1.8 is still within LTS until the end of 2017.
2017-04-12 15:06:19 +10:00
viatrak 8cb4d174a6 Update tests to reflect new IDs in Errors and Warnings 2017-03-24 12:19:52 -05:00
viatrak 8f1480ad62 Add IDs to system checks. Can now be used in SILENCED_SYSTEM_CHECKS 2017-03-24 11:56:00 -05:00
Stéphane Raimbault cf154c6463 Upgrade installation documentation for Django 1.8+ 2017-03-21 14:59:42 +01:00
Adnan Umer 26692945c1 Updated Django 1.10 Version Check 2017-03-16 00:52:07 +05:00
Adnan Umer d2df0951a2 Django 1.10 Support 2017-03-16 00:47:17 +05:00
Mateu Cànaves 45157bf459 Update docs with new command info 2017-03-10 16:11:15 +01:00
Mateu Cànaves c5c1f06d71 Added parallel migration executor to tox and travis 2017-03-10 16:09:59 +01:00
Mateu Cànaves 323cfcd38a Add migration executors 2017-03-10 16:06:03 +01:00
João Ricardo Lourenço 2630ecbee4 Fix assert 2017-03-09 16:37:44 +00:00
João Ricardo Lourenço b0dc8bdb54 Add an advanced usage section to the documentation 2017-03-09 16:33:57 +00:00
João Ricardo Lourenço d80ac3ace5 Make self.get_tenant backwards compatible. Handle exceptions within process_request 2017-03-09 16:33:28 +00:00
João Ricardo Lourenço 06a1b9d570 Support Python 2.6+ 2017-03-08 20:19:07 +00:00
João Ricardo Lourenço f532cbacc9 Replicate old behavior where we raise self.TENANT_NOT_FOUND_EXCEPTION for DefaultTenantMiddleware 2017-03-08 20:15:55 +00:00
João Ricardo Lourenço 540f32cab6 Raise NotImplementedError in get_tenant 2017-03-08 19:03:20 +00:00
João Ricardo Lourenço 3223661559 Add BaseTenantMiddleware for easier custom middleware support 2017-03-08 18:04:23 +00:00
David Jean Louis a7b3805f11 Fix compatibility issue with django < 1.9 2017-02-28 15:07:31 +01:00
David Jean Louis e51748612f Make sure tenant delete() method is called, even when using django querysets bulk delete method (fixes issue #446). 2017-02-28 14:54:04 +01:00
Gary Reynolds 8f71ffed76 Bump version: 1.6.11 → 1.7.0 2017-02-23 07:56:52 +11:00
Gary Reynolds b6d1b5afbc Add bumpversion configuration 2017-02-23 07:55:07 +11:00
Gary Reynolds 2e789f71bc TenantStorageMixin (#442)
* Add a tenant aware storage backend.

Using a mixin that can be combined with existing core and 3rd party
storage backends which isolates user uploaded media by introducing a
directory based on the schema_name (which shouldn't change after it's
been created) and a symbolic link from the domain_url to the directory.

In the reverse proxy, the domain_url can be parametrised to serve the
content via the symbolic link.

* WARN if project is not using a tenant aware storage backend.

* Add collectstatic_schemas management command

* Update the __all__ directive for tenant_schemas.storage

* Update test project for storage mixins

* Add documentation for DEFAULT_FILE_STORAGE changes
2017-02-22 20:08:37 +11:00
Gary Reynolds 8b7201f9b9 Update README to remove non-ASCII characters. Refs #434. 2017-02-22 20:07:46 +11:00
Alexander van Eck 3579735cb3 #424: Added IF EXISTS to DROP SCHEMA queries 2017-02-22 19:37:02 +11:00
Gary Reynolds 93a0780c34 Merge pull request #436 from stephane/stephane/docs
Checker warns about 'tenant_schemas' position in INSTALLED_APPS
2017-02-10 23:44:31 +11:00
Stéphane Raimbault 80b148eb1b 'tenant_schemas' must be put at the top of INSTALLED_APPS 2017-02-09 21:59:58 +01:00
Stéphane Raimbault aef4292b9f Cleanup trailing spaces in documentation 2017-02-09 21:59:31 +01:00
Gary Reynolds 32b85e3bad Merge pull request #421 from AlexvEck/default-tenant-fix
Closes #383.

Thank you to @UnrealAkama for the original contribution and @AlexvEck for adding the initial tests.
2017-01-27 07:02:26 +11:00
Alexander van Eck 7227047d9b Moved default schema_name determination to except to it is only triggered when the sought tenant is not found. 2017-01-26 08:57:15 +01:00
Alexander van Eck dade581ff6 Merge pull request #1 from goodtune/default-tenant-middleware
Move to a middleware only based solution, no new settings required.
2017-01-26 08:54:49 +01:00
Gary Reynolds 59d34fc7a9 Add test that deals with a missing default tenant 2017-01-26 14:34:00 +11:00
Gary Reynolds 736c2bcfe0 Update middleware.py 2017-01-26 09:21:39 +11:00
Gary Reynolds c77c13199b Fix typo in documentation 2017-01-26 09:16:10 +11:00
Gary Reynolds 6c96dee256 Merge pull request #433 from AlexvEck/features/#430-better-check-for-django-tenant_schemas-placement
#430 - Check wether tenant_schemas comes before any django apps instead of before all apps.
2017-01-26 09:07:35 +11:00
Alexander van Eck 50a9c696cf Changed wording on warning and refactored into startswith instead of in. 2017-01-25 23:02:31 +01:00
Alexander van Eck 4c207fc676 #430 - Added an index check for ‘tenant_schemas’ in INSTALLED_APPS that checks whether it is placed before any django app instead if it is placed first. 2017-01-25 16:47:35 +01:00
Alexander van Eck 1efa8700c8 Merge branch 'default-tenant-fix' into default-tenant-middleware 2017-01-25 16:02:27 +01:00