plain.dev 0.29.0__py3-none-any.whl → 0.29.2__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.
- plain/dev/cli.py +15 -21
- {plain_dev-0.29.0.dist-info → plain_dev-0.29.2.dist-info}/METADATA +1 -1
- {plain_dev-0.29.0.dist-info → plain_dev-0.29.2.dist-info}/RECORD +6 -6
- {plain_dev-0.29.0.dist-info → plain_dev-0.29.2.dist-info}/WHEEL +0 -0
- {plain_dev-0.29.0.dist-info → plain_dev-0.29.2.dist-info}/entry_points.txt +0 -0
- {plain_dev-0.29.0.dist-info → plain_dev-0.29.2.dist-info}/licenses/LICENSE +0 -0
plain/dev/cli.py
CHANGED
@@ -49,8 +49,8 @@ ENTRYPOINT_GROUP = "plain.dev"
|
|
49
49
|
@click.option(
|
50
50
|
"--log-level",
|
51
51
|
"-l",
|
52
|
-
default="
|
53
|
-
type=click.Choice(["debug", "info", "warning", "error", "critical"]),
|
52
|
+
default="",
|
53
|
+
type=click.Choice(["debug", "info", "warning", "error", "critical", ""]),
|
54
54
|
help="Log level",
|
55
55
|
)
|
56
56
|
def cli(ctx, port, hostname, log_level):
|
@@ -145,10 +145,13 @@ class Dev:
|
|
145
145
|
self.plain_env = {
|
146
146
|
"PYTHONUNBUFFERED": "true",
|
147
147
|
"PLAIN_DEV": "true",
|
148
|
-
"PLAIN_LOG_LEVEL": self.log_level.upper(),
|
149
|
-
"APP_LOG_LEVEL": self.log_level.upper(),
|
150
148
|
**os.environ,
|
151
149
|
}
|
150
|
+
|
151
|
+
if log_level:
|
152
|
+
self.plain_env["PLAIN_LOG_LEVEL"] = log_level.upper()
|
153
|
+
self.plain_env["APP_LOG_LEVEL"] = log_level.upper()
|
154
|
+
|
152
155
|
self.custom_process_env = {
|
153
156
|
**self.plain_env,
|
154
157
|
"PORT": str(self.port),
|
@@ -198,7 +201,7 @@ class Dev:
|
|
198
201
|
|
199
202
|
self.symlink_plain_src()
|
200
203
|
self.modify_hosts_file()
|
201
|
-
self.
|
204
|
+
self.set_allowed_hosts()
|
202
205
|
self.run_preflight()
|
203
206
|
|
204
207
|
# If we start services ourselves, we should manage the pidfile
|
@@ -351,22 +354,13 @@ class Dev:
|
|
351
354
|
)
|
352
355
|
sys.exit(1)
|
353
356
|
|
354
|
-
def
|
355
|
-
if "PLAIN_CSRF_TRUSTED_ORIGINS" not in os.environ:
|
356
|
-
csrf_trusted_origins = json.dumps(
|
357
|
-
[
|
358
|
-
self.url,
|
359
|
-
]
|
360
|
-
)
|
361
|
-
self.plain_env["PLAIN_CSRF_TRUSTED_ORIGINS"] = csrf_trusted_origins
|
362
|
-
self.custom_process_env["PLAIN_CSRF_TRUSTED_ORIGINS"] = csrf_trusted_origins
|
363
|
-
click.secho(
|
364
|
-
f"Automatically set PLAIN_CSRF_TRUSTED_ORIGINS={csrf_trusted_origins}",
|
365
|
-
dim=True,
|
366
|
-
)
|
367
|
-
|
357
|
+
def set_allowed_hosts(self):
|
368
358
|
if "PLAIN_ALLOWED_HOSTS" not in os.environ:
|
369
|
-
|
359
|
+
hostnames = [self.hostname]
|
360
|
+
if self.tunnel_url:
|
361
|
+
# Add the tunnel URL to the allowed hosts
|
362
|
+
hostnames.append(self.tunnel_url.split("://")[1])
|
363
|
+
allowed_hosts = json.dumps(hostnames)
|
370
364
|
self.plain_env["PLAIN_ALLOWED_HOSTS"] = allowed_hosts
|
371
365
|
self.custom_process_env["PLAIN_ALLOWED_HOSTS"] = allowed_hosts
|
372
366
|
click.secho(
|
@@ -404,7 +398,7 @@ class Dev:
|
|
404
398
|
"--timeout",
|
405
399
|
"60",
|
406
400
|
"--log-level",
|
407
|
-
self.log_level,
|
401
|
+
self.log_level or "info",
|
408
402
|
"--access-logfile",
|
409
403
|
"-",
|
410
404
|
"--error-logfile",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
plain/dev/README.md,sha256=EQJ9lF-JQ9KQWJZ_j6CD3jbRquOLgDRlIPbgT7A2gG4,3658
|
2
2
|
plain/dev/__init__.py,sha256=nRX1B0Br8gmqhJLqo5Z9PqzReDahBtbmwH6C-7hzuls,103
|
3
|
-
plain/dev/cli.py,sha256=
|
3
|
+
plain/dev/cli.py,sha256=TqL2eDM5_0Sv_GcIpT5O0sbrvWIgiwMU6ZPyLZJ9qUs,15324
|
4
4
|
plain/dev/debug.py,sha256=Ka84K8zUdF0kMYNyqiLYDrdzU1jU8LSOkts3hcw_Gok,1005
|
5
5
|
plain/dev/default_settings.py,sha256=uXWYORWP_aRDwXIFXdu5kHyiBFUZzARIJdhPeFaX35c,75
|
6
6
|
plain/dev/entrypoints.py,sha256=diqNwA6eydUMtoO7p_rH-DtSYsw5-GBmjFe1Z5bHagc,579
|
@@ -24,8 +24,8 @@ plain/dev/poncho/process.py,sha256=JJOKy-C6vMCg7-6JMCtu6C649h7HmOBSJqDP_hnX49I,2
|
|
24
24
|
plain/dev/precommit/__init__.py,sha256=9ByBOIdM8DebChjNz-RH2atdz4vWe8somlwNEsbhwh4,40
|
25
25
|
plain/dev/precommit/cli.py,sha256=KVHcG3Y_JZJNu3_MLIrO5s6yMYQfAArIU5L0hNWZUjg,3441
|
26
26
|
plain/dev/templates/dev/requests.html,sha256=kQKJZq5L77juuL_t8UjcAehEU61U4RXNnKaAET-wAm8,7627
|
27
|
-
plain_dev-0.29.
|
28
|
-
plain_dev-0.29.
|
29
|
-
plain_dev-0.29.
|
30
|
-
plain_dev-0.29.
|
31
|
-
plain_dev-0.29.
|
27
|
+
plain_dev-0.29.2.dist-info/METADATA,sha256=jgWka03LvNVb8qv2UcBRzqZMmxGOf_gGrQ_eqgJ-JHY,4163
|
28
|
+
plain_dev-0.29.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
29
|
+
plain_dev-0.29.2.dist-info/entry_points.txt,sha256=zrcTOiFk_MLKsnYVlwVP7aMm1XLEqq7w4EBkJ-3ge-g,114
|
30
|
+
plain_dev-0.29.2.dist-info/licenses/LICENSE,sha256=Cx4Dq9yR2fLHthf8Ke36B8QJvE1bZFXVzDIGE8wGzsY,4132
|
31
|
+
plain_dev-0.29.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|