Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of concept: multi-tenant support using postgres schemas and django-tenants #123

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jcass77
Copy link

@jcass77 jcass77 commented Nov 22, 2018

Not sure if this is too specific to be merged in django-cachalot, but posting it here in case it may be useful to anybody.

django-tenants makes use of postgres schemas to provide each tenant in a multi-tenant django deployment with their own database tables. This seems like a good usecase for django-cachalot as such deployments probably stand to benefit a lot from caching.

By default, django-tenants just adds the schema name to the cache keys so that each tenant can operate its own cache without risking unexpected collisions. This PR essentially just adds a new implementation of make_key so that all tables in the public schema can be shared between tenants:

  • adds django_tenants.postgresql_backend to the list of supported database backends, which is essentially just django-tenants' wrapper around django.db.backends.postgresql_psycopg2 for managing the schemas.

  • introduces a new get_multi_tenant_table_cache_key that can be configured via settings.CACHALOT_TABLE_KEYGEN to generate the new cache keys - no effect on existing implementations unless explicitly activated.

This PR could probably be easily adapted to also support django-tenant-schemas in a similar fashion.

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

8 similar comments
@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 635

  • 162 of 169 (95.86%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 99.119%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/cache.py 7 8 87.5%
cachalot/panels.py 6 8 75.0%
cachalot/tenants.py 52 56 92.86%
Totals Coverage Status
Change from base Build 633: -0.2%
Covered Lines: 3264
Relevant Lines: 3293

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

9 similar comments
@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 22, 2018

Pull Request Test Coverage Report for Build 520

  • 28 of 146 (19.18%) changed or added relevant lines in 4 files are covered.
  • 364 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-3.6%) to 95.95%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cachalot/panels.py 7 8 87.5%
cachalot/cache.py 8 12 66.67%
cachalot/utils.py 13 49 26.53%
cachalot/tests/tenants.py 0 77 0.0%
Files with Coverage Reduction New Missed Lines %
cachalot/monkey_patch.py 1 100.0%
cachalot/api.py 2 96.67%
cachalot/utils.py 2 74.85%
cachalot/tests/test_utils.py 6 100.0%
cachalot/tests/transaction.py 9 100.0%
cachalot/tests/write.py 32 100.0%
cachalot/tests/read.py 60 100.0%
cachalot/tests/thread_safety.py 72 100.0%
cachalot/tests/postgres.py 180 100.0%
Totals Coverage Status
Change from base Build 517: -3.6%
Covered Lines: 3127
Relevant Lines: 3259

💛 - Coveralls

@jcass77
Copy link
Author

jcass77 commented Nov 24, 2018

I can't figure out why the tests are failing for python 2.7 - anybody have any ideas?

@Andrew-Chen-Wang
Copy link
Collaborator

@jcass77 Merge latest commits in master to check again. Lots of weird errors arose during testing that I patched up.

@Andrew-Chen-Wang
Copy link
Collaborator

Andrew-Chen-Wang commented Mar 17, 2020

That's an interesting error. It's a tox error regarding InvocationError. I've taken a look at this SO question and it seems like there might've been an import error. I haven't touched the code since the 2.2.0 release, so it's somewhere in your code base. @jcass77

@Andrew-Chen-Wang
Copy link
Collaborator

Andrew-Chen-Wang commented Mar 17, 2020

I'm also coming to the realization that adding this could cause me to hassle on and understand Django-tenants. If I were to add this to the next release, it would be an overload of code to maintain, especially when Django 3 is trying to make a HUGE overhaul in how we handle databases (new release of psycopg3 in cooperation with the Django dev team in order to assist with accessing Postgres asynchronously while being thread safe).
Thus, I think it'd be best if you forked this repo and constantly update your fork with merges between this master branch and yours. Pip installing would be very different in that people would be using git to install it: https://stackoverflow.com/a/30292809

@jcass77
Copy link
Author

jcass77 commented Apr 16, 2020

Thanks for taking a look at this @Andrew-Chen-Wang - I've merged in all of the latest changes from the 'master' branch.

All of the tests are now green except for Django 1.11 running on Python 2.7. Since neither of those versions are officially supported anymore I'm not going to worry about it.

I agree that this usecase might be too specific to merge into the official release of Django-cachalot. Would you mind keeping this pull request open, perhaps with a 'wontfix' label, so that others can find it more easily?

@Andrew-Chen-Wang
Copy link
Collaborator

@jcass77 I won't mind merging some of the engines into the package as I've decided to allow unobtrusive code into the repository. Stuff like the added settings.py supported backend can be merged in, and if you'd like to write a doc page along with how to integrate the code (somehow), I'd be happy to merge that in as well. It'd be best if you did this in a separate PR, and I'll leave this one open for reference, I suppose.

But, for now, I still can't maintain this repository to support other packages' code integrations, so the tests for the new obtrusive code still can't fly.

@thenewguy
Copy link

This is awesome =)

@itzomen
Copy link

itzomen commented Mar 1, 2022

This is great 👌

@thenewguy
Copy link

@jcass77 are you using this successfully in a production environment?

@jcass77
Copy link
Author

jcass77 commented Mar 22, 2023

@jcass77 are you using this successfully in a production environment?

Yes I was up to about the middle of 2021. I am no longer supporting that production environment though.

@sherwin-cax
Copy link

Yes I was up to about the middle of 2021. I am no longer supporting that production environment though.

@jcass77 What caching solutions are you currently using with Django tenants?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants