df_site 0.1.5__py3-none-any.whl → 0.1.7__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.
- df_site/dynamic_settings.py +16 -11
- df_site/static/css/base.css +5 -22192
- df_site/static/css/ckeditor5.css +0 -315
- df_site/static/css/ckeditor5.css.map +1 -1
- df_site/static/js/app.js +4 -10
- df_site/static/js/app.js.map +1 -1
- df_site/static/js/base.js +117203 -138607
- df_site/static/js/base.js.map +1 -1
- {df_site-0.1.5.dist-info → df_site-0.1.7.dist-info}/METADATA +7 -7
- {df_site-0.1.5.dist-info → df_site-0.1.7.dist-info}/RECORD +13 -13
- {df_site-0.1.5.dist-info → df_site-0.1.7.dist-info}/WHEEL +1 -1
- {df_site-0.1.5.dist-info → df_site-0.1.7.dist-info}/LICENSE +0 -0
- {df_site-0.1.5.dist-info → df_site-0.1.7.dist-info}/entry_points.txt +0 -0
df_site/dynamic_settings.py
CHANGED
@@ -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
|
-
|
28
|
-
|
29
|
-
|
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")
|