django-dbbackup 5.3.0__tar.gz → 5.3.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.
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/PKG-INFO +2 -2
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/__init__.py +1 -1
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/postgresql.py +12 -1
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/_base.py +13 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/.gitignore +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/LICENSE.md +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/README.md +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/apps.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/checks.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/__init__.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/base.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/django.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/exceptions.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/mongodb.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/mysql.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/db/sqlite.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/log.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/__init__.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/__init__.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/dbbackup.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/dbrestore.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/listbackups.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/mediabackup.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/mediarestore.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/settings.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/signals.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/storage.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/utils.py +0 -0
- {django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: django-dbbackup
|
|
3
|
-
Version: 5.3.
|
|
3
|
+
Version: 5.3.1
|
|
4
4
|
Summary: Management commands to help backup and restore a project database and media.
|
|
5
5
|
Project-URL: Changelog, https://archmonger.github.io/django-dbbackup/latest/changelog/
|
|
6
6
|
Project-URL: Documentation, https://archmonger.github.io/django-dbbackup
|
|
@@ -10,6 +10,13 @@ from dbbackup.db.base import BaseCommandDBConnector
|
|
|
10
10
|
logger = logging.getLogger("dbbackup.command")
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
def _host_requires_uri_quoting(host: str) -> bool:
|
|
14
|
+
# Match *nix paths (e.g. /run/postgres) and Windows paths (e.g. C:\path\to\socket)
|
|
15
|
+
return host.startswith(("/", "@")) or (
|
|
16
|
+
len(host) >= 3 and host[0].isalpha() and host[1] == ":" and host[2] in ("/", "\\")
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
13
20
|
def parse_postgres_settings(connector: PgDumpBinaryConnector | PgDumpConnector) -> tuple[str, dict[Any, Any]]:
|
|
14
21
|
"""
|
|
15
22
|
Parse the common Postgres connectors settings and
|
|
@@ -22,7 +29,11 @@ def parse_postgres_settings(connector: PgDumpBinaryConnector | PgDumpConnector)
|
|
|
22
29
|
Returns:
|
|
23
30
|
tuple: (cmd_part, environment_dict)
|
|
24
31
|
"""
|
|
25
|
-
host = connector.settings.get("HOST"
|
|
32
|
+
host = connector.settings.get("HOST")
|
|
33
|
+
if host is None:
|
|
34
|
+
host = "localhost"
|
|
35
|
+
elif _host_requires_uri_quoting(host):
|
|
36
|
+
host = quote(host, safe="")
|
|
26
37
|
cmd_part = connector.settings.get("NAME", "")
|
|
27
38
|
user = quote(connector.settings.get("USER") or "")
|
|
28
39
|
password = connector.settings.get("PASSWORD", -1)
|
|
@@ -85,6 +85,19 @@ class BaseDbBackupCommand(BaseCommand):
|
|
|
85
85
|
level = 60 if self.quiet else LOGGING_VERBOSITY[int(self.verbosity)]
|
|
86
86
|
self.logger.setLevel(level)
|
|
87
87
|
|
|
88
|
+
# Find or create a StreamHandler for console output so that
|
|
89
|
+
# --verbosity works regardless of the user's Django LOGGING
|
|
90
|
+
# configuration. Only add one handler to avoid duplicates.
|
|
91
|
+
for handler in self.logger.handlers:
|
|
92
|
+
if isinstance(handler, logging.StreamHandler):
|
|
93
|
+
handler.setLevel(level)
|
|
94
|
+
break
|
|
95
|
+
else:
|
|
96
|
+
handler = logging.StreamHandler(sys.stderr)
|
|
97
|
+
handler.setLevel(level)
|
|
98
|
+
handler.setFormatter(logging.Formatter("%(levelname)s %(message)s"))
|
|
99
|
+
self.logger.addHandler(handler)
|
|
100
|
+
|
|
88
101
|
def _ask_confirmation(self):
|
|
89
102
|
answer = input("Are you sure you want to continue? [Y/n] ")
|
|
90
103
|
if answer.lower().startswith("n"):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dbbackup-5.3.0 → django_dbbackup-5.3.1}/dbbackup/management/commands/mediarestore.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|