django-multisite2 2.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. django-multisite2-2.1.1/.coveragerc +3 -0
  2. django-multisite2-2.1.1/.github/workflows/build.yml +74 -0
  3. django-multisite2-2.1.1/.gitignore +24 -0
  4. django-multisite2-2.1.1/.pre-commit-config.yaml +49 -0
  5. django-multisite2-2.1.1/.yamllint +13 -0
  6. django-multisite2-2.1.1/CHANGELOG.rst +129 -0
  7. django-multisite2-2.1.1/LICENSE +28 -0
  8. django-multisite2-2.1.1/MANIFEST.in +3 -0
  9. django-multisite2-2.1.1/PKG-INFO +244 -0
  10. django-multisite2-2.1.1/README.rst +217 -0
  11. django-multisite2-2.1.1/django_multisite2.egg-info/PKG-INFO +244 -0
  12. django-multisite2-2.1.1/django_multisite2.egg-info/SOURCES.txt +151 -0
  13. django-multisite2-2.1.1/django_multisite2.egg-info/dependency_links.txt +1 -0
  14. django-multisite2-2.1.1/django_multisite2.egg-info/not-zip-safe +1 -0
  15. django-multisite2-2.1.1/django_multisite2.egg-info/requires.txt +1 -0
  16. django-multisite2-2.1.1/django_multisite2.egg-info/top_level.txt +2 -0
  17. django-multisite2-2.1.1/multisite/__init__.py +2 -0
  18. django-multisite2-2.1.1/multisite/__pycache__/__init__.cpython-310.pyc +0 -0
  19. django-multisite2-2.1.1/multisite/__pycache__/__init__.cpython-311.pyc +0 -0
  20. django-multisite2-2.1.1/multisite/__pycache__/__init__.cpython-312.pyc +0 -0
  21. django-multisite2-2.1.1/multisite/__pycache__/__init__.cpython-39.pyc +0 -0
  22. django-multisite2-2.1.1/multisite/__pycache__/__version__.cpython-310.pyc +0 -0
  23. django-multisite2-2.1.1/multisite/__pycache__/__version__.cpython-311.pyc +0 -0
  24. django-multisite2-2.1.1/multisite/__pycache__/__version__.cpython-312.pyc +0 -0
  25. django-multisite2-2.1.1/multisite/__pycache__/__version__.cpython-39.pyc +0 -0
  26. django-multisite2-2.1.1/multisite/__pycache__/apps.cpython-312.pyc +0 -0
  27. django-multisite2-2.1.1/multisite/__pycache__/exceptions.cpython-312.pyc +0 -0
  28. django-multisite2-2.1.1/multisite/__pycache__/forms.cpython-310.pyc +0 -0
  29. django-multisite2-2.1.1/multisite/__pycache__/forms.cpython-311.pyc +0 -0
  30. django-multisite2-2.1.1/multisite/__pycache__/forms.cpython-312.pyc +0 -0
  31. django-multisite2-2.1.1/multisite/__pycache__/forms.cpython-39.pyc +0 -0
  32. django-multisite2-2.1.1/multisite/__pycache__/hacks.cpython-310.pyc +0 -0
  33. django-multisite2-2.1.1/multisite/__pycache__/hacks.cpython-311.pyc +0 -0
  34. django-multisite2-2.1.1/multisite/__pycache__/hacks.cpython-312.pyc +0 -0
  35. django-multisite2-2.1.1/multisite/__pycache__/hacks.cpython-39.pyc +0 -0
  36. django-multisite2-2.1.1/multisite/__pycache__/test_settings.cpython-310-pytest-6.2.5.pyc +0 -0
  37. django-multisite2-2.1.1/multisite/__pycache__/test_settings.cpython-311-pytest-8.1.1.pyc +0 -0
  38. django-multisite2-2.1.1/multisite/__pycache__/test_settings.cpython-312-pytest-7.4.4.pyc +0 -0
  39. django-multisite2-2.1.1/multisite/__pycache__/test_settings.cpython-312-pytest-8.1.1.pyc +0 -0
  40. django-multisite2-2.1.1/multisite/__pycache__/test_settings.cpython-39-pytest-6.2.5.pyc +0 -0
  41. django-multisite2-2.1.1/multisite/__pycache__/tests.cpython-310-pytest-6.2.5.pyc +0 -0
  42. django-multisite2-2.1.1/multisite/__pycache__/tests.cpython-311-pytest-8.1.1.pyc +0 -0
  43. django-multisite2-2.1.1/multisite/__pycache__/tests.cpython-312-pytest-7.4.4.pyc +0 -0
  44. django-multisite2-2.1.1/multisite/__pycache__/tests.cpython-312-pytest-8.1.1.pyc +0 -0
  45. django-multisite2-2.1.1/multisite/__pycache__/tests.cpython-39-pytest-6.2.5.pyc +0 -0
  46. django-multisite2-2.1.1/multisite/__pycache__/threadlocals.cpython-310.pyc +0 -0
  47. django-multisite2-2.1.1/multisite/__pycache__/threadlocals.cpython-311.pyc +0 -0
  48. django-multisite2-2.1.1/multisite/__pycache__/threadlocals.cpython-312.pyc +0 -0
  49. django-multisite2-2.1.1/multisite/__pycache__/threadlocals.cpython-39.pyc +0 -0
  50. django-multisite2-2.1.1/multisite/__pycache__/utils.cpython-312.pyc +0 -0
  51. django-multisite2-2.1.1/multisite/__version__.py +1 -0
  52. django-multisite2-2.1.1/multisite/admin/__init__.py +3 -0
  53. django-multisite2-2.1.1/multisite/admin/__pycache__/__init__.cpython-312.pyc +0 -0
  54. django-multisite2-2.1.1/multisite/admin/__pycache__/alias_admin.cpython-312.pyc +0 -0
  55. django-multisite2-2.1.1/multisite/admin/__pycache__/multisite_changelist.cpython-312.pyc +0 -0
  56. django-multisite2-2.1.1/multisite/admin/__pycache__/multisite_model_admin.cpython-312.pyc +0 -0
  57. django-multisite2-2.1.1/multisite/admin/alias_admin.py +58 -0
  58. django-multisite2-2.1.1/multisite/admin/multisite_changelist.py +64 -0
  59. django-multisite2-2.1.1/multisite/admin/multisite_model_admin.py +161 -0
  60. django-multisite2-2.1.1/multisite/apps.py +29 -0
  61. django-multisite2-2.1.1/multisite/exceptions.py +57 -0
  62. django-multisite2-2.1.1/multisite/forms.py +22 -0
  63. django-multisite2-2.1.1/multisite/hacks.py +163 -0
  64. django-multisite2-2.1.1/multisite/management/__init__.py +0 -0
  65. django-multisite2-2.1.1/multisite/management/__pycache__/__init__.cpython-310.pyc +0 -0
  66. django-multisite2-2.1.1/multisite/management/__pycache__/__init__.cpython-311.pyc +0 -0
  67. django-multisite2-2.1.1/multisite/management/__pycache__/__init__.cpython-312.pyc +0 -0
  68. django-multisite2-2.1.1/multisite/management/__pycache__/__init__.cpython-39.pyc +0 -0
  69. django-multisite2-2.1.1/multisite/management/commands/__init__.py +0 -0
  70. django-multisite2-2.1.1/multisite/management/commands/__pycache__/__init__.cpython-310.pyc +0 -0
  71. django-multisite2-2.1.1/multisite/management/commands/__pycache__/__init__.cpython-311.pyc +0 -0
  72. django-multisite2-2.1.1/multisite/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
  73. django-multisite2-2.1.1/multisite/management/commands/__pycache__/__init__.cpython-39.pyc +0 -0
  74. django-multisite2-2.1.1/multisite/management/commands/__pycache__/update_public_suffix_list.cpython-310.pyc +0 -0
  75. django-multisite2-2.1.1/multisite/management/commands/__pycache__/update_public_suffix_list.cpython-311.pyc +0 -0
  76. django-multisite2-2.1.1/multisite/management/commands/__pycache__/update_public_suffix_list.cpython-312.pyc +0 -0
  77. django-multisite2-2.1.1/multisite/management/commands/__pycache__/update_public_suffix_list.cpython-39.pyc +0 -0
  78. django-multisite2-2.1.1/multisite/management/commands/update_public_suffix_list.py +33 -0
  79. django-multisite2-2.1.1/multisite/middleware/__init__.py +4 -0
  80. django-multisite2-2.1.1/multisite/middleware/__pycache__/__init__.cpython-312.pyc +0 -0
  81. django-multisite2-2.1.1/multisite/middleware/__pycache__/cookie_domain_middleware.cpython-312.pyc +0 -0
  82. django-multisite2-2.1.1/multisite/middleware/__pycache__/dynamic_site_middleware.cpython-312.pyc +0 -0
  83. django-multisite2-2.1.1/multisite/middleware/cookie_domain_middleware.py +72 -0
  84. django-multisite2-2.1.1/multisite/middleware/dynamic_site_middleware.py +195 -0
  85. django-multisite2-2.1.1/multisite/migrations/0001_initial.py +71 -0
  86. django-multisite2-2.1.1/multisite/migrations/0002_alter_alias_id_alter_alias_is_canonical.py +32 -0
  87. django-multisite2-2.1.1/multisite/migrations/0003_alter_alias_options_alter_alias_unique_together_and_more.py +41 -0
  88. django-multisite2-2.1.1/multisite/migrations/__init__.py +0 -0
  89. django-multisite2-2.1.1/multisite/migrations/__pycache__/0001_initial.cpython-310.pyc +0 -0
  90. django-multisite2-2.1.1/multisite/migrations/__pycache__/0001_initial.cpython-311.pyc +0 -0
  91. django-multisite2-2.1.1/multisite/migrations/__pycache__/0001_initial.cpython-312.pyc +0 -0
  92. django-multisite2-2.1.1/multisite/migrations/__pycache__/0001_initial.cpython-39.pyc +0 -0
  93. django-multisite2-2.1.1/multisite/migrations/__pycache__/0002_alter_alias_id_alter_alias_is_canonical.cpython-310.pyc +0 -0
  94. django-multisite2-2.1.1/multisite/migrations/__pycache__/0002_alter_alias_id_alter_alias_is_canonical.cpython-311.pyc +0 -0
  95. django-multisite2-2.1.1/multisite/migrations/__pycache__/0002_alter_alias_id_alter_alias_is_canonical.cpython-312.pyc +0 -0
  96. django-multisite2-2.1.1/multisite/migrations/__pycache__/0002_alter_alias_id_alter_alias_is_canonical.cpython-39.pyc +0 -0
  97. django-multisite2-2.1.1/multisite/migrations/__pycache__/0003_alias_multisite_alias_canon_site_uniq.cpython-311.pyc +0 -0
  98. django-multisite2-2.1.1/multisite/migrations/__pycache__/0003_alter_alias_options_alter_alias_unique_together_and_more.cpython-312.pyc +0 -0
  99. django-multisite2-2.1.1/multisite/migrations/__pycache__/__init__.cpython-310.pyc +0 -0
  100. django-multisite2-2.1.1/multisite/migrations/__pycache__/__init__.cpython-311.pyc +0 -0
  101. django-multisite2-2.1.1/multisite/migrations/__pycache__/__init__.cpython-312.pyc +0 -0
  102. django-multisite2-2.1.1/multisite/migrations/__pycache__/__init__.cpython-39.pyc +0 -0
  103. django-multisite2-2.1.1/multisite/models/__init__.py +3 -0
  104. django-multisite2-2.1.1/multisite/models/__pycache__/__init__.cpython-312.pyc +0 -0
  105. django-multisite2-2.1.1/multisite/models/__pycache__/alias.cpython-312.pyc +0 -0
  106. django-multisite2-2.1.1/multisite/models/__pycache__/managers.cpython-312.pyc +0 -0
  107. django-multisite2-2.1.1/multisite/models/__pycache__/signals.cpython-312.pyc +0 -0
  108. django-multisite2-2.1.1/multisite/models/__pycache__/validators.cpython-312.pyc +0 -0
  109. django-multisite2-2.1.1/multisite/models/alias.py +110 -0
  110. django-multisite2-2.1.1/multisite/models/managers.py +196 -0
  111. django-multisite2-2.1.1/multisite/models/signals.py +36 -0
  112. django-multisite2-2.1.1/multisite/models/validators.py +14 -0
  113. django-multisite2-2.1.1/multisite/tests/__init__.py +0 -0
  114. django-multisite2-2.1.1/multisite/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  115. django-multisite2-2.1.1/multisite/tests/__pycache__/get_test_allowed_hosts.cpython-312.pyc +0 -0
  116. django-multisite2-2.1.1/multisite/tests/__pycache__/get_test_http_response.cpython-312.pyc +0 -0
  117. django-multisite2-2.1.1/multisite/tests/__pycache__/test_settings.cpython-312-pytest-8.1.1.pyc +0 -0
  118. django-multisite2-2.1.1/multisite/tests/__pycache__/test_settings.cpython-312.pyc +0 -0
  119. django-multisite2-2.1.1/multisite/tests/__pycache__/tests.cpython-312-pytest-8.1.1.pyc +0 -0
  120. django-multisite2-2.1.1/multisite/tests/get_test_allowed_hosts.py +14 -0
  121. django-multisite2-2.1.1/multisite/tests/get_test_http_response.py +13 -0
  122. django-multisite2-2.1.1/multisite/tests/hosts.py +46 -0
  123. django-multisite2-2.1.1/multisite/tests/test_settings.py +23 -0
  124. django-multisite2-2.1.1/multisite/tests/tests/__init__.py +0 -0
  125. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/__init__.cpython-312.pyc +0 -0
  126. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/request_factory.cpython-312.pyc +0 -0
  127. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_alias.cpython-312.pyc +0 -0
  128. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_contrib_site.cpython-312.pyc +0 -0
  129. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_cookie_domain_middleware.cpython-312.pyc +0 -0
  130. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_dynamic_site_middleware.cpython-312.pyc +0 -0
  131. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_site_cache.cpython-312.pyc +0 -0
  132. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_site_domain.cpython-312.pyc +0 -0
  133. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_site_id.cpython-312.pyc +0 -0
  134. django-multisite2-2.1.1/multisite/tests/tests/__pycache__/test_template_loader.cpython-312.pyc +0 -0
  135. django-multisite2-2.1.1/multisite/tests/tests/request_factory.py +12 -0
  136. django-multisite2-2.1.1/multisite/tests/tests/test_alias.py +272 -0
  137. django-multisite2-2.1.1/multisite/tests/tests/test_contrib_site.py +21 -0
  138. django-multisite2-2.1.1/multisite/tests/tests/test_cookie_domain_middleware.py +196 -0
  139. django-multisite2-2.1.1/multisite/tests/tests/test_dynamic_site_middleware.py +262 -0
  140. django-multisite2-2.1.1/multisite/tests/tests/test_site_cache.py +127 -0
  141. django-multisite2-2.1.1/multisite/tests/tests/test_site_domain.py +24 -0
  142. django-multisite2-2.1.1/multisite/tests/tests/test_site_id.py +76 -0
  143. django-multisite2-2.1.1/multisite/tests/tests/test_template_loader.py +49 -0
  144. django-multisite2-2.1.1/multisite/threadlocals.py +149 -0
  145. django-multisite2-2.1.1/multisite/utils.py +165 -0
  146. django-multisite2-2.1.1/multisite_app/__init__.py +0 -0
  147. django-multisite2-2.1.1/multisite_app/apps.py +6 -0
  148. django-multisite2-2.1.1/multisite_app/urls.py +5 -0
  149. django-multisite2-2.1.1/multisite_app/views.py +8 -0
  150. django-multisite2-2.1.1/pyproject.toml +32 -0
  151. django-multisite2-2.1.1/runtests.py +18 -0
  152. django-multisite2-2.1.1/setup.cfg +59 -0
@@ -0,0 +1,3 @@
1
+ [run]
2
+ source=multisite
3
+ omit=multisite/tests.py,multisite/migrations/*,multisite/south_migrations/*
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: build
3
+
4
+ on: [push, pull_request]
5
+
6
+ jobs:
7
+ build:
8
+ name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
9
+ runs-on: ubuntu-latest
10
+
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ['3.11', '3.12']
15
+ django-version: ['4.2', '5.0', 'dev']
16
+
17
+ exclude:
18
+ - python-version: '3.12'
19
+ django-version: '4.2'
20
+ - python-version: '3.11'
21
+ django-version: 'dev'
22
+ services:
23
+ mysql:
24
+ image: mysql:latest
25
+ env:
26
+ MYSQL_DATABASE: mysql
27
+ MYSQL_ROOT_PASSWORD: mysql
28
+ ports:
29
+ - 3306:3306
30
+ options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
31
+
32
+ steps:
33
+ - name: Install pycups and words dependency
34
+ run: |
35
+ sudo sed -i 's/azure\.//' /etc/apt/sources.list
36
+ sudo apt-get -y update
37
+ sudo apt-get install libcups2-dev wamerican
38
+
39
+ - uses: actions/checkout@v4
40
+ - name: Set up Python ${{ matrix.python-version }}
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: ${{ matrix.python-version }}
44
+
45
+ - name: Get pip cache dir
46
+ id: pip-cache
47
+ run: |
48
+ echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT
49
+
50
+ - name: Cache
51
+ uses: actions/cache@v4
52
+ with:
53
+ path: ${{ steps.pip-cache.outputs.dir }}
54
+ key:
55
+ ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
56
+ restore-keys: |
57
+ ${{ matrix.python-version }}-v1-
58
+
59
+ - name: Install dependencies
60
+ run: |
61
+ python -m pip install --upgrade pip
62
+ python -m pip install -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/tox.txt
63
+
64
+
65
+ - name: Tox tests
66
+ run: |
67
+ tox -v
68
+ env:
69
+ DJANGO: ${{ matrix.django-version }}
70
+
71
+ - name: Upload coverage to Codecov
72
+ uses: codecov/codecov-action@v3
73
+ with:
74
+ name: Python ${{ matrix.python-version }}
@@ -0,0 +1,24 @@
1
+ build/
2
+ dist/
3
+ etc/
4
+ .etc/
5
+ .env
6
+ _version.py
7
+ *.pyc
8
+ *.pyo
9
+ .cache/
10
+ .eggs/
11
+ .installed.cfg
12
+ bin
13
+ develop-eggs
14
+ django_multisite.egg-info/
15
+ dist
16
+ downloads
17
+ eggs
18
+ parts
19
+ MANIFEST
20
+ multisite/*.egg-info
21
+ django_multisite_edc.egg-info/*
22
+ .coverage
23
+ .tox/
24
+ .pytest_cache/
@@ -0,0 +1,49 @@
1
+ ---
2
+ exclude: tests/etc/user-*
3
+
4
+ repos:
5
+ - repo: https://github.com/PyCQA/bandit
6
+ rev: 1.7.5
7
+ hooks:
8
+ - id: bandit
9
+ args:
10
+ - "-x *test*.py"
11
+
12
+ - repo: https://github.com/psf/black
13
+ rev: 23.11.0
14
+ hooks:
15
+ - id: black
16
+ language_version: python3.10
17
+
18
+ - repo: https://github.com/pycqa/flake8
19
+ rev: 6.1.0
20
+ hooks:
21
+ - id: flake8
22
+ args:
23
+ - "--config=setup.cfg"
24
+
25
+ - repo: https://github.com/PyCQA/isort
26
+ rev: 5.12.0
27
+ hooks:
28
+ - id: isort
29
+
30
+ - repo: https://github.com/pre-commit/pre-commit-hooks
31
+ rev: v4.5.0
32
+ hooks:
33
+ - id: requirements-txt-fixer
34
+ files: requirements/.*\.txt$
35
+ - id: trailing-whitespace
36
+ - id: check-added-large-files
37
+ - id: fix-byte-order-marker
38
+ - id: check-docstring-first
39
+ - id: check-executables-have-shebangs
40
+ - id: check-merge-conflict
41
+ - id: debug-statements
42
+ - id: detect-private-key
43
+
44
+ - repo: https://github.com/adrienverge/yamllint
45
+ rev: v1.33.0
46
+ hooks:
47
+ - id: yamllint
48
+ args:
49
+ - "--strict"
@@ -0,0 +1,13 @@
1
+ # allow "on" until yamllint stops checking keys for truthy!
2
+ # https://github.com/adrienverge/yamllint/issues/158
3
+ ---
4
+ extends: default
5
+
6
+ rules:
7
+ comments-indentation: disable
8
+ braces: disable
9
+ line-length:
10
+ max: 120
11
+ truthy:
12
+ level: error
13
+ allowed-values: ['true', 'false', 'on']
@@ -0,0 +1,129 @@
1
+ =============
2
+ Release Notes
3
+ =============
4
+
5
+ 2.0.1
6
+ -----
7
+ - change rel.to to related_model (Django 4.2)
8
+
9
+ 1.9.0
10
+ -----
11
+
12
+ * Fix tldextract version 3.0.0 breaking changes (Issue #72 / PR #74)
13
+ * Fix test requirements missing Django
14
+ * Fix Pluggy dependency version conflict
15
+ * Remove support for Python 3.5 / Django < 1.11
16
+
17
+ 1.8.0
18
+ ----------
19
+
20
+ - Support for Django 3.0 (PR #68 - thanks @erikvw)
21
+ - Fix middleware usage post Django 2.0 (PR #69 thanks @mihalikv)
22
+
23
+ 1.7.0
24
+ -----
25
+
26
+ * Support Django 2.1 and 2.2 (PR #59 - thanks @ribeiroti!)
27
+ * Replace queryset with get_queryset in admin (PR #61 - thanks @vit-ivanov!)
28
+
29
+ 1.6.0
30
+ -----
31
+ * Fix KeyError from _get_site_by_id
32
+ * Drop support for Django 1.7
33
+ * Remove unnecessary cache type warnings
34
+ * Remove deprecated SiteIDHook
35
+
36
+ 1.5.0
37
+ -----
38
+ * Support Django 2.0 (PR #47 and #60)
39
+ * Remove code for Django < 1.7
40
+ * Remove obsolete PathAssistedCurrentSiteManager
41
+ * Remove obsolete template.loaders.cached
42
+ * Update README to better describe local development setup
43
+
44
+ 1.4.1
45
+ -----
46
+ * Specify Django <2.0 in setup.py
47
+ * Drop support for python 3.3
48
+
49
+ 1.4.0
50
+ -----
51
+ * Support Django 1.10 (PR #38) and 1.11
52
+ * Support Python 3
53
+ * Remove support for Django <1.7
54
+ * Use setuptools over distutils, and integrate the tests with them
55
+ * Use pytest and tox for testing
56
+ * Set up CI with travis
57
+ * Set up coverage and coveralls.io
58
+ * Document MULTISITE_EXTRA_HOSTS in README
59
+
60
+ 1.3.1
61
+ -----
62
+
63
+ * Add default for SiteID in the README (PR #31)
64
+ * Respect the CACHE_MULTISITE_ALIAS in SiteCache (PR #34)
65
+ * Replace deprecated ExtractResult().tld with .suffic (PR #32)
66
+
67
+ 1.3.0
68
+ -----
69
+
70
+ * Fix tempfile issue with update_public_suffix_list command
71
+ * Support for tldextract version >= 2.0
72
+
73
+ 1.2.6
74
+ ----
75
+
76
+ * Pin the tldextract dependency to version < 2.0, which breaks API.
77
+
78
+ 1.2.5
79
+ ----
80
+
81
+ * Make template loading more resilient to changes in django (thanks to jbazik for the contribution)
82
+
83
+ 1.2.4
84
+ -----
85
+
86
+ * Fix domain validation so it's called after the pre_save signal
87
+
88
+ 1.2.3
89
+ -----
90
+
91
+ * Fix a broken test, due to a django uniqueness constraint in 1.9
92
+
93
+ 1.2.2
94
+ -----
95
+
96
+ * Fix for 1.9: change the return type of filesystem template loader's get_template_sources()
97
+
98
+ 1.2.1
99
+ -----
100
+
101
+ * Remove django.utils.unittest (deprecated in 1.9)
102
+ * Use post_migrate instead of post_syncdb in > 1.7
103
+
104
+ 1.2.0
105
+ -----
106
+
107
+ * We now support Django 1.9
108
+ * Following deprecation in django, all get_cache methods have been replaced caches.
109
+
110
+ 1.1.0
111
+ -----
112
+
113
+ * We now support post-South Django 1.7 native migrations.
114
+
115
+ 1.0.0
116
+ -----
117
+
118
+ * 1.0 release. API stability promised from now on.
119
+ * Following the deprecation in Django itself, all get_query_set methods have been renamed to get_queryset. This means Django 1.6 is now the minimum required version.
120
+
121
+ 0.5.1
122
+ -----
123
+
124
+ * Add key prefix tests
125
+
126
+ 0.5.0
127
+ -----
128
+
129
+ * Allow use of cache key prefixes from the CACHES settings if CACHE_MULTISITE_KEY_PREFIX not set
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, Ecometrica
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ include INSTALL.txt
2
+ include README.rst
3
+ graft multisite
@@ -0,0 +1,244 @@
1
+ Metadata-Version: 2.1
2
+ Name: django-multisite2
3
+ Version: 2.1.1
4
+ Summary: Serve multiple sites from a single Django application
5
+ Home-page: http://github.com/erikvw/django-multisite
6
+ Author: Leonid S Shestera
7
+ Author-email: leonid@shestera.ru
8
+ Maintainer: Ecometrica
9
+ Maintainer-email: dev@ecometrica.com
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Web Environment
12
+ Classifier: Framework :: Django
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: BSD License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Internet
20
+ Classifier: Topic :: Internet :: WWW/HTTP
21
+ Classifier: Topic :: Software Development :: Libraries
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.11
24
+ Description-Content-Type: text/x-rst
25
+ License-File: LICENSE
26
+ Requires-Dist: tldextract
27
+
28
+ |pypi| |actions| |codecov| |downloads| |maintainability| |black|
29
+
30
+
31
+
32
+ README
33
+ ======
34
+
35
+ Install with pip::
36
+
37
+ pip install django-multisite-edc
38
+
39
+
40
+ Quickstart
41
+ ----------
42
+
43
+ Replace your SITE_ID in settings.py to::
44
+
45
+ from multisite import SiteID
46
+ SITE_ID = SiteID(default=1)
47
+
48
+ Add these to your INSTALLED_APPS::
49
+
50
+ INSTALLED_APPS = [
51
+ ...
52
+ 'django.contrib.sites',
53
+ 'multisite',
54
+ ...
55
+ ]
56
+
57
+ Add to your settings.py TEMPLATES loaders in the OPTIONS section::
58
+
59
+ TEMPLATES = [
60
+ ...
61
+ {
62
+ ...
63
+ 'DIRS': {...}
64
+ 'OPTIONS': {
65
+ 'loaders': (
66
+ 'multisite.template.loaders.filesystem.Loader',
67
+ 'django.template.loaders.app_directories.Loader',
68
+ )
69
+ }
70
+ ...
71
+ }
72
+ ...
73
+ ]
74
+
75
+ Edit settings.py MIDDLEWARE::
76
+
77
+ MIDDLEWARE = (
78
+ ...
79
+ 'multisite.middleware.DynamicSiteMiddleware',
80
+ ...
81
+ )
82
+
83
+ Append to settings.py, in order to use a custom cache that can be
84
+ safely cleared::
85
+
86
+ # The cache connection to use for django-multisite.
87
+ # Default: 'default'
88
+ CACHE_MULTISITE_ALIAS = 'multisite'
89
+
90
+ # The cache key prefix that django-multisite should use.
91
+ # If not set, defaults to the KEY_PREFIX used in the defined
92
+ # CACHE_MULTISITE_ALIAS or the default cache (empty string if not set)
93
+ CACHE_MULTISITE_KEY_PREFIX = ''
94
+
95
+ If you have set CACHE\_MULTISITE\_ALIAS to a custom value, *e.g.*
96
+ ``'multisite'``, add a separate backend to settings.py CACHES::
97
+
98
+ CACHES = {
99
+ 'default': {
100
+ ...
101
+ },
102
+ 'multisite': {
103
+ 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
104
+ 'TIMEOUT': 60 * 60 * 24, # 24 hours
105
+ ...
106
+ },
107
+ }
108
+
109
+ Development Environments
110
+ ------------------------
111
+ Multisite returns a valid Alias when in "development mode" (defaulting to the
112
+ alias associated with the default SiteID.
113
+
114
+ Development mode is either:
115
+ - Running tests, i.e. manage.py test
116
+ - Running locally in settings.DEBUG = True, where the hostname is a top-level name, i.e. localhost
117
+
118
+ In order to have multisite use aliases in local environments, add entries to
119
+ your local etc/hosts file to match aliases in your applications. E.g. ::
120
+
121
+ 127.0.0.1 example.com
122
+ 127.0.0.1 examplealias.com
123
+
124
+ And access your application at example.com:8000 or examplealias.com:8000 instead of
125
+ the usual localhost:8000.
126
+
127
+
128
+ Domain fallbacks
129
+ ----------------
130
+
131
+ By default, if the domain name is unknown, multisite will respond with
132
+ an HTTP 404 Not Found error. To change this behaviour, add to
133
+ settings.py::
134
+
135
+ # The view function or class-based view that django-multisite will
136
+ # use when it cannot match the hostname with a Site. This can be
137
+ # the name of the function or the function itself.
138
+ # Default: None
139
+ MULTISITE_FALLBACK = 'django.views.generic.base.RedirectView
140
+
141
+ # Keyword arguments for the MULTISITE_FALLBACK view.
142
+ # Default: {}
143
+ MULTISITE_FALLBACK_KWARGS = {'url': 'http://example.com/',
144
+ 'permanent': False}
145
+
146
+ Templates
147
+ ---------
148
+ If required, create template subdirectories for domain level templates (in a
149
+ location specified in settings.TEMPLATES['DIRS'].
150
+
151
+ Multisite's template loader will look for templates in folders with the names of
152
+ domains, such as::
153
+
154
+ templates/example.com
155
+
156
+
157
+ The template loader will also look for templates in a folder specified by the
158
+ optional MULTISITE_DEFAULT_TEMPLATE_DIR setting, e.g.::
159
+
160
+ templates/multisite_templates
161
+
162
+
163
+ Cross-domain cookies
164
+ --------------------
165
+
166
+ In order to support `cross-domain cookies`_,
167
+ for purposes like single-sign-on,
168
+ prepend the following to the top of
169
+ settings.py MIDDLEWARE (MIDDLEWARE_CLASSES for Django < 1.10)::
170
+
171
+ MIDDLEWARE = (
172
+ 'multisite.middleware.CookieDomainMiddleware',
173
+ ...
174
+ )
175
+
176
+ CookieDomainMiddleware will consult the `Public Suffix List`_
177
+ for effective top-level domains.
178
+ It caches this file
179
+ in the system's default temporary directory
180
+ as ``effective_tld_names.dat``.
181
+ To change this in settings.py::
182
+
183
+ MULTISITE_PUBLIC_SUFFIX_LIST_CACHE = '/path/to/multisite_tld.dat'
184
+
185
+ By default,
186
+ any cookies without a domain set
187
+ will be reset to allow \*.domain.tld.
188
+ To change this in settings.py::
189
+
190
+ MULTISITE_COOKIE_DOMAIN_DEPTH = 1 # Allow only *.subdomain.domain.tld
191
+
192
+ In order to fetch a new version of the list,
193
+ run::
194
+
195
+ manage.py update_public_suffix_list
196
+
197
+ .. _cross-domain cookies: http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Path
198
+ .. _Public Suffix List: http://publicsuffix.org/
199
+
200
+ Post-migrate signal: post_migrate_sync_alias
201
+ --------------------------------------------
202
+ The `post-migrate` signal `post_migrate_sync_alias` is registered in the `apps.py`. `post_migrate_sync_alias`
203
+ ensures the `domain` in multisite's `Alias` model is updated to match that of django's `Site` model. This signal must
204
+ run AFTER any `post-migrate` signals that manipulate Django's `Site` model. If you have an app that manipulates Django's
205
+ `Site` model, place it before `multisite` in `settings. INSTALLED_APPS`. If this is not possible, you may configure `multisite`
206
+ to not connect the `post-migrate` signal in `apps.py` so that you can do it somewhere else in your code.
207
+
208
+ To configure `multisite` to not connect the `post-post_migrate_sync_alias` in the `apps.py`, update your settings::
209
+
210
+ MULTISITE_REGISTER_POST_MIGRATE_SYNC_ALIAS = False
211
+
212
+ With the `settings` attribute set to `False`, it is your responsibility to connect the signal in your code. Note that if you do not sync the `Alias` and `Site`
213
+ models after the `Site` model has changed, multisite may not recognize the domain and switch to the fallback view or
214
+ raise a `Http404` error.
215
+
216
+ Tests
217
+ -----
218
+
219
+ To run the tests::
220
+
221
+ python runtests.py
222
+
223
+
224
+
225
+ .. |pypi| image:: https://img.shields.io/pypi/v/django-multisite.svg
226
+ :target: https://pypi.python.org/pypi/django-multisite
227
+
228
+ .. |actions| image:: https://github.com/erikvw/django-multisite/actions/workflows/build.yml/badge.svg
229
+ :target: https://github.com/erikvw/django-multisite/actions/workflows/build.yml
230
+
231
+ .. |codecov| image:: https://codecov.io/gh/erikvw/django-multisite/branch/develop/graph/badge.svg
232
+ :target: https://codecov.io/gh/erikvw/django-multisite
233
+
234
+ .. |downloads| image:: https://pepy.tech/badge/django-multisite
235
+ :target: https://pepy.tech/project/django-multisite
236
+
237
+ .. |maintainability| image:: https://api.codeclimate.com/v1/badges/d280e92995a883a4f8db/maintainability
238
+ :target: https://codeclimate.com/github/erikvw/django-multisite/maintainability
239
+ :alt: Maintainability
240
+
241
+ .. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
242
+ :target: https://github.com/ambv/black
243
+ :alt: Code Style
244
+