Commit Graph

624 Commits

Author SHA1 Message Date
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
Gary Reynolds 8941fb1cd8 Fix spelling mistake in test cases 2017-01-26 01:55:33 +11:00
Gary Reynolds b24faa0a73 Add middlewares to documentation (commented) 2017-01-26 01:44:55 +11:00
Gary Reynolds 71804949d7 Update tests and fix bug in DefaultTenantMiddleware.get_tenant 2017-01-26 01:41:00 +11:00
Alexander van Eck e1fda76f50 Updated documentation to reflect changes 2017-01-25 15:16:34 +01:00
Alexander van Eck 88156be136 Added DefaultSchemaTenantMiddleware and created a method for get_tenant so it can be easily overwritten. Updated tests for the new middleware class 2017-01-25 15:08:11 +01:00
Gary Reynolds 5f169a276c Alternative implementation without introducing new settings.
Create a new subclass of TenantMiddleware which handles the fallback scenario.
2017-01-26 00:53:36 +11:00
Alexander van Eck 36d4966a03 Renamed DEFAULT_SCHEMA to DEFAULT_SCHEMA_NAME and added with.settings instead of overwriting settings in a test. 2017-01-25 14:32:51 +01:00
Alexander van Eck 021e667231 Added Default_Schema settings to the install.rst documentation 2017-01-01 11:38:19 +01:00
Alexander van Eck 1b3cd3e79b Changed setting name to DEFAULT_SCHEMA to be more in line with django. 2017-01-01 11:38:19 +01:00
Alexander van Eck 1b797d5430 Added tests for the SHEMA_DEFAULT setting in TenantMiddleware 2017-01-01 11:38:19 +01:00
Adam Ringwood ab5c7088a0 Patching default schema setting in. 2017-01-01 11:38:19 +01:00
Bernardo Pires 1a83c52221 4th attempt at travis and pypi 2017-01-01 08:15:19 +01:00
Bernardo Pires 6e6c8673ef Third attempt at travis autocommit to pypi 2017-01-01 08:07:09 +01:00
Bernardo Pires eb0f6cf660 Second attempt for travis auto deploy to pypi 2017-01-01 08:04:33 +01:00
Bernardo Pires 03d1c97821 Trying again the travis auto commit to pypi 2017-01-01 07:09:39 +01:00
Gary Reynolds 76bd651707 Try dropping wheel dist to push to PyPI. 2016-12-18 00:57:59 +11:00
Gary Reynolds d091d2e356 Update apps.py
Populate `app_configs` if it is `None`.
2016-12-10 14:35:45 +11:00
Gary Reynolds 73a0495267 Update .travis.yml to trigger deploy on tags
Wrapped the encrypted password to fit on narrow displays, including
github.com
2016-12-01 06:24:49 +11:00
Bernardo Pires 72b828ad38 Fixes #411 2016-11-28 23:51:28 +01:00
Gary Reynolds e941200413 Merge pull request #407 from goodtune/version-support-statement
Document a position on supported versions of Django & PostgreSQL
2016-11-19 00:37:22 +11:00
Gary Reynolds 835c49b930 Update README.rst and setup.py
- update package classifiers to make the pyversions badge work
- add badges for PostgreSQL versions supported
2016-11-11 17:26:23 +11:00
Gary Reynolds 2190883129 Document a position on supported versions of Django & PostgreSQL
- policy for Django (all currently supported versions)
- policy for PostgreSQL (minimum version of latest Django version)

Upped the link to PostgreSQL's schema documentation to match new minimum (9.2).
2016-11-11 17:26:23 +11:00
Gary Reynolds 7d4428cc77 Merge pull request #402 from goodtune/issue-302
Refactor ImproperlyConfigured to system check framework
2016-11-11 17:24:06 +11:00
Gary Reynolds 7d2d8e8db5 Query the apps registry in test cases
The override_settings module looks after revising the cache, so no need to
build our own - the settings.INSTALLED_APPS was holding unexpected values
(strangely only in Python 3.5, though) but this should give the expected
outcome every time.
2016-11-11 17:17:08 +11:00