df_site 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl

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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  import os
4
4
  from typing import Any, Optional
5
+ from urllib.parse import urlparse
5
6
 
6
7
 
7
8
  def allauth_signup_form(values: dict[str, Any]) -> Optional[str]:
@@ -22,16 +23,20 @@ def are_tests_running(values: dict[str, Any]) -> bool:
22
23
  are_tests_running.required_settings = ["ALLOWED_HOSTS"]
23
24
 
24
25
 
26
+ def patch_tox_environment(url_variable: str, host_variable: str, port_variable: str):
27
+ """Patch a single URL for the workaround for https://github.com/tox-dev/tox-docker/issues/55."""
28
+ if not all(x in os.environ for x in (host_variable, port_variable, url_variable)):
29
+ return
30
+ parsed_url = urlparse(os.environ[url_variable])
31
+ if parsed_url.username or parsed_url.password:
32
+ netloc = f"{parsed_url.username}:{parsed_url.password}@{os.environ[host_variable]}:{os.environ[port_variable]}"
33
+ else:
34
+ netloc = f"{os.environ[host_variable]}:{os.environ[port_variable]}"
35
+ os.environ[url_variable] = parsed_url._replace(netloc=netloc).geturl()
36
+
37
+
25
38
  def load_tox_environment():
26
39
  """Is a workaround for https://github.com/tox-dev/tox-docker/issues/55."""
27
- if os.environ.get("REDIS_HOST") and os.environ.get("REDIS_6379_TCP_PORT"):
28
- os.environ["REDIS_URL"] = f'redis://:p_df_site@{os.environ["REDIS_HOST"]}:{os.environ["REDIS_6379_TCP_PORT"]}/1'
29
- if os.environ.get("POSTGRES_HOST") and os.environ.get("POSTGRES_5432_TCP_PORT"):
30
- os.environ["DATABASE_URL"] = (
31
- f'postgresql://u_df_site:p_df_site@{os.environ["POSTGRES_HOST"]}:'
32
- f'{os.environ["POSTGRES_5432_TCP_PORT"]}/d_df_site'
33
- )
34
- if os.environ.get("MINIO_HOST") and os.environ.get("MINIO_9000_TCP_PORT"):
35
- os.environ["MAIN_STORAGE_DIR"] = (
36
- f's3:http://u_df_site:p_df_site@127.0.0.1:' f'{os.environ["MINIO_9000_TCP_PORT"]}/f_df_site'
37
- )
40
+ patch_tox_environment("REDIS_URL", "REDIS_HOST", "REDIS_6379_TCP_PORT")
41
+ patch_tox_environment("DATABASE_URL", "POSTGRES_HOST", "POSTGRES_5432_TCP_PORT")
42
+ patch_tox_environment("MAIN_STORAGE_DIR", "MINIO_HOST", "MINIO_9000_TCP_PORT")
df_site/middleware.py CHANGED
@@ -13,7 +13,7 @@ def websocket_middleware(get_response):
13
13
 
14
14
  response: HttpResponse = get_response(request)
15
15
  # noinspection PyUnresolvedReferences
16
- if not request.has_websocket_topics:
16
+ if hasattr(request, "has_websocket_topics") and not request.has_websocket_topics:
17
17
  set_websocket_topics(request)
18
18
  return response
19
19
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: df_site
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: More batteries to Django
5
5
  Home-page: https://github.com/d9pouces/df_site
6
6
  License: CECILL-B
@@ -22,9 +22,9 @@ Classifier: Operating System :: Unix
22
22
  Classifier: Programming Language :: Python :: 3
23
23
  Classifier: Programming Language :: Python :: 3.10
24
24
  Classifier: Programming Language :: Python :: 3.11
25
- Classifier: Programming Language :: Python :: 3 :: Only
26
25
  Classifier: Programming Language :: Python :: 3.12
27
26
  Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Programming Language :: Python :: 3 :: Only
28
28
  Requires-Dist: df-config (>=1.2.42)
29
29
  Requires-Dist: df-websockets (>=1.0.9,<2.0.0)
30
30
  Requires-Dist: django (>=5.0)
@@ -34,21 +34,21 @@ Requires-Dist: django-ckeditor-5 (>=0.2.13,<0.3.0)
34
34
  Requires-Dist: django-cookie-consent (>=0.6.0,<0.7.0)
35
35
  Requires-Dist: django-csp (>=3.7,<4.0)
36
36
  Requires-Dist: django-minio-storage (>=0.5.7,<0.6.0)
37
- Requires-Dist: django-pipeline (>=3.1.0,<4.0.0)
37
+ Requires-Dist: django-pipeline (>=4.0.0,<5.0.0)
38
38
  Requires-Dist: django-postman (>=4.5,<5.0)
39
39
  Requires-Dist: django-prometheus (>=2.3.1,<3.0.0)
40
- Requires-Dist: django-prose-editor (>=0.8.0,<0.9.0)
40
+ Requires-Dist: django-prose-editor (>=0.10.2,<0.11.0)
41
41
  Requires-Dist: django-recaptcha (>=4.0.0,<5.0.0)
42
42
  Requires-Dist: django-redis (>=5.4.0,<6.0.0)
43
43
  Requires-Dist: django-redis-sessions (>=0.6.2,<0.7.0)
44
44
  Requires-Dist: django-tinymce (>=4.1.0,<5.0.0)
45
45
  Requires-Dist: fido2 (>=1.1.3,<2.0.0)
46
46
  Requires-Dist: jsmin (>=3.0.1,<4.0.0)
47
- Requires-Dist: lxml-html-clean (>=0.3.1,<0.4.0)
47
+ Requires-Dist: lxml-html-clean (>=0.4.1,<0.5.0)
48
48
  Requires-Dist: nh3 (>=0.2.18,<0.3.0)
49
49
  Requires-Dist: psycopg (>=3.2.1,<4.0.0)
50
- Requires-Dist: redis (>=5.0.1,<6.0.0)
51
- Requires-Dist: uvicorn-worker (>=0.2.0,<0.3.0)
50
+ Requires-Dist: redis (>=5.2.0,<6.0.0)
51
+ Requires-Dist: uvicorn-worker (>=0.3.0,<0.4.0)
52
52
  Project-URL: Documentation, https://github.com/d9pouces/df_site
53
53
  Project-URL: Repository, https://github.com/d9pouces/df_site
54
54
  Description-Content-Type: text/markdown
@@ -11,13 +11,13 @@ df_site/components/registry.py,sha256=vz0eDglRKv7iUiHKepou3-HU4D-nD7Fbiclqt5jZc7
11
11
  df_site/constants.py,sha256=p4bcwM55SIQM-hSGgiEoLwZxFuFl2aILCJc-_kwbGLM,1847
12
12
  df_site/context_processors.py,sha256=2bgltZEzONA2MPtfV9pXuddjNoSb9c5o5J13tqnajC4,2425
13
13
  df_site/defaults.py,sha256=aZGrjV39mPbHT2UshWc4hHi7lxGqcmJXkUMfegL5HQM,8976
14
- df_site/dynamic_settings.py,sha256=h4LbkEsafDR9_WyHk6xH0TciqYYo5rj87sjYC_-sFuo,1537
14
+ df_site/dynamic_settings.py,sha256=5wNglFRUEQbTLYMzXMB4gt1-rSCyC_hOlACAOlLpfcw,1776
15
15
  df_site/form_fields.py,sha256=ExEwKdBl1FL78jDHiGp0UGZFaVzoojZV8JirvDPlei8,5189
16
16
  df_site/management/__init__.py,sha256=hSw7cwoTyIwJGrh37pQspBcO_i9LZPT850YyAP6HWNU,37
17
17
  df_site/management/commands/__init__.py,sha256=oEAGub9PHNeJLfHQ2zs4AIrbuxZui1z_n3Tyc97h98w,32
18
18
  df_site/management/commands/add_image.py,sha256=mjFG2qmOG2YQ9jQYD6PXzW7pBe-Aez-QR8rCzMjQX-8,4139
19
19
  df_site/management/commands/generate_favicon.py,sha256=UwVGr0pWws9CiXQ4VVwU-qcijI_f2GMji6iuxoXkoys,1728
20
- df_site/middleware.py,sha256=lLcITsik5pED466UWKo8YCfGY8mQKI9l2CwskHvngLw,637
20
+ df_site/middleware.py,sha256=i48S6YGe8iOTPKYYXg07ePIXb5LOT1KscsmHh6T1pMA,682
21
21
  df_site/migrations/0001_initial.py,sha256=6XoKucB8jcD3Y4Zj7jLlqSzyLnkwZkMs93DDBhJ-gD8,8425
22
22
  df_site/migrations/0002_alter_alertribbon_message_alter_alertribbon_summary.py,sha256=YNZfVU2Z_s_Q1D4d3YZT7nQJ4mafhOfsoRXS1lg6sD4,676
23
23
  df_site/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -148,7 +148,6 @@ df_site/static/images/unlink.svg,sha256=sKR5A1UaIz7agCKeMAxThJ9BqMnWlEF5kTYIEMq0
148
148
  df_site/static/js/app.js,sha256=5fK5aarXf0eJFBOprDCnDBYyHbTGo7ftnE6TE78gk5Y,33962
149
149
  df_site/static/js/app.js.map,sha256=G6JIMpibVmGyERXxgOgHz8C3Pft7cmuMuXbDUmz8AnM,2789
150
150
  df_site/static/js/base.js,sha256=xYFUwr4XmYyKmc-pQhdPbVEHpQz5M1fAInxFAiPr2-I,7679901
151
- df_site/static/js/base.js.map,sha256=PnxDE-OB3MT6L8W_7aBFGWOUgSVcvJCkisk88PNB7tc,7001291
152
151
  df_site/static/translations/af.js,sha256=GNijZEmnFJtCDAsuWtbUekCcrycPJHWI4wIG9jb6KrI,3534
153
152
  df_site/static/translations/ar.js,sha256=2sstm-bZl3ZJh7h9lmQCS8Yg9WooQb7f0wWOBblVikc,41587
154
153
  df_site/static/translations/ast.js,sha256=IkxquSEA7dtTC-FjdnJdwdPOx-9xnpJ89IZQ3TLea9c,4697
@@ -303,8 +302,8 @@ df_site/users/notifications.py,sha256=jAUrHxreW-Nsam3AM8N3vPt45LOS2J2mMR_t3Dbv6I
303
302
  df_site/users/urls.py,sha256=f5A2oMTV3dQGfsTRZs6YRD5jVDIqPZPZALIB0sjOkM0,515
304
303
  df_site/users/views.py,sha256=uMMgXe4J-YChpYavTReos_MuNfLaz1fjmPq3oD36mLw,2770
305
304
  df_site/views.py,sha256=DYe0iyIL7xTrdZKiXjaFnubmtUXJnhKccx8QaMcN_0o,4525
306
- df_site-0.1.4.dist-info/LICENSE,sha256=H1HcYtCa2qQNIP1AnRy8KUQRjHqfoDN4MoJHKIt_w6g,22399
307
- df_site-0.1.4.dist-info/METADATA,sha256=ldlDBDmK6U9_twa9vdBvpk8yhBAVRsOVJy0lXoH_0bk,9881
308
- df_site-0.1.4.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
309
- df_site-0.1.4.dist-info/entry_points.txt,sha256=QBlDeF1v1FepN-bJk7FuhWtgm7Y7-dhBK6673t94_7k,59
310
- df_site-0.1.4.dist-info/RECORD,,
305
+ df_site-0.1.6.dist-info/LICENSE,sha256=H1HcYtCa2qQNIP1AnRy8KUQRjHqfoDN4MoJHKIt_w6g,22399
306
+ df_site-0.1.6.dist-info/METADATA,sha256=UK4aRID6Llv2jYPy7LkAcHdol0Ndqjn5XoX1QQKbIdE,9883
307
+ df_site-0.1.6.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
308
+ df_site-0.1.6.dist-info/entry_points.txt,sha256=QBlDeF1v1FepN-bJk7FuhWtgm7Y7-dhBK6673t94_7k,59
309
+ df_site-0.1.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.7.0
2
+ Generator: poetry-core 2.0.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any