Commit Graph

13 Commits

Author SHA1 Message Date
Gary Reynolds bd99102e2e Deal with backwards compatibility by exception. 2017-06-02 17:56:37 +10:00
Adnan Umer 8634634b1c Django 1.9 Support 2017-04-17 15:52:37 +05: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
Gary Reynolds ea95f3f7a4 Refactor ImproperlyConfigured to system check framework
- ensure TENANT_APPS is defined in settings.py
- ensure TENANT_MODEL is defined in settings.py
- ensure TenantSyncRouter appears in DATABASE_ROUTERS
- ensure public schema and any existing tenant schemas are not listed in PG_EXTRA_SEARCH_PATHS
- raise error when TENANT_APPS is empty
- issue warning when 'tenant_schemas' is not the last item in INSTALLED_APPS
- issue warning when items in TENANT_APPS are not in INSTALLED_APPS
- add checks for SHARED_APPS
- add test cases for the best_practice system check
- update install documentation which previously suggested concatenation
- fix import path of get_public_schema_name
- fix failing test case for TenantContextFilter
- update tox.ini
- add .travis.yml
- PEP8 fixes
2016-11-11 07:57:14 +11:00
Gary Reynolds 1a48f6c57b Fix regression introduced in cb8862d
- path construction changed from domain_url to schema_name
2016-07-19 07:12:46 +10:00
Gary Reynolds cb8862d026 Remove Django < 1.8 compatibility
- resolves template loading in Django 1.8+ (thanks to @tomturner)
 - removed code branches based on django.VERSION value
 - updated documentation to remove details of removed functionality

Closes #289
2016-05-18 22:18:31 +10:00
Gary Reynolds b5faeabecb Prevent template loader operating when FakeTenant is the active connection.tenant
The FakeTenant does not have a domain_url attribute. Alternative would be to set domain_url, but it seems more appropriate to bypass this loader for the FakeTenant.
2015-03-29 11:48:40 +11:00
Bernardo Pires 1019e0186c pep8 2014-12-27 17:01:08 +01:00
Bernardo Pires d986d276d2 Merge pull request #167 from bdauvergne/wip/improve-template-loader-path
Allow to store templates in a subdirectory of a tenant directory
2014-08-23 21:22:48 -07:00
Anton Ovchinnikov f740df449d PEP8 and typos 2014-08-21 10:33:24 +02:00
Benjamin Dauvergne 18e7e422b1 Allow to store template in a subdirectory of a tenant directory
For example use MULTITENANT_TEMPLATE_DIRS =
('/var/lib/tenants/%s/templates/',) instead of just
('/var/lib/tenants/templates/',).
2014-08-14 16:47:17 +02:00
Benjamin Dauvergne 0fcf1b95d7 add template loaders looking for template based on the current tenant
CachedLoader is similar to the django.template.loaders.cached.Loader but
it adds the tenant instance id to the key used for caching.

FilesystemLoader is similar to django.template.loaders.filesyste.Loader
but it uses the setting key MULTITENANT_TEMPLATE_DIRS instead of
TEMPLATE_DIRS and looks for template inside the directory
os.path.join(MULTITENANT_TEMPLATE_DIRS, tenant.domain_url).
2014-04-02 00:15:49 +02:00