Skip to content

Commit a87b14d

Browse files
committed
Misc updates
- Remove old templates - Remove print statement - Add repo - Update project template
1 parent c84492e commit a87b14d

File tree

49 files changed

+34
-1756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+34
-1756
lines changed

django_mongodb_cli/project.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ def migrate_project(
228228
None,
229229
help="Optional MongoDB connection URI. Falls back to $MONGODB_URI if not provided.",
230230
),
231+
database: str = typer.Option(
232+
None,
233+
help="Specify the database to migrate.",
234+
),
231235
):
232236
"""
233237
Run Django migrations using django-admin instead of manage.py.
@@ -238,7 +242,8 @@ def migrate_project(
238242
cmd.append(app_label)
239243
if migration_name:
240244
cmd.append(migration_name)
241-
245+
if database:
246+
cmd.append(f"--database={database}")
242247
typer.echo(f"📦 Applying migrations for project '{name}'")
243248
_django_manage_command(
244249
name, directory, *cmd, extra_env=_build_mongodb_env(mongodb_uri)
@@ -277,6 +282,10 @@ def manage_command(
277282
mongodb_uri: str = typer.Option(
278283
None, "--mongodb-uri", help="MongoDB connection URI"
279284
),
285+
database: str = typer.Option(
286+
None,
287+
help="Specify the database to use.",
288+
),
280289
):
281290
"""
282291
Run any django-admin command for a project.
@@ -297,6 +306,9 @@ def manage_command(
297306

298307
os.environ["MONGODB_URI"] = mongodb_uri
299308

309+
if database:
310+
args.append(f"--database={database}")
311+
300312
if command:
301313
typer.echo(f"⚙️ Running django-admin {command} {' '.join(args)} for '{name}'")
302314
_django_manage_command(name, directory, command, *args)

django_mongodb_cli/templates/project_template/project_name/settings/project_name.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616
"NAME": "{{ project_name }}_encrypted",
1717
"OPTIONS": {
1818
"auto_encryption_opts": AutoEncryptionOpts(
19-
kms_providers={"local": {"key": os.urandom(96)}}, # noqa
20-
key_vault_namespace="keyvault.__keyVault",
19+
kms_providers={
20+
"local": {
21+
"key": b"tO\x7f\xf2L0\x9e\xab\xcd'\xd3\xd4'P\xf5;3\x94\xde8\xd7\xa4\xc5J\xe9\xb7\xc6\t\xbe\xa3<\xb3\xbe\xb3\xe5E\xb1\xdf[\xfb\x94\x8c`\x9e\xa20*\x82\x16\x98\xa32\x11\xa6\xeb\xfa\x05e\x08/\xe2\x01\xe8\xf1'#\xf9E\xde\xb0\x07Z\x93V\x84.\xf5\xb9\xdbR\xf6\xf6!\xd7;\xa9c\x087\xa1f\x9c\x1b\x86\xe8D"
22+
}
23+
},
24+
key_vault_namespace="{{ project_name }}_encrypted.__keyVault",
2125
),
2226
},
2327
}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ repos = [
8686
"mongo @ git+ssh://[email protected]/mongodb/mongo@master",
8787
"drivers-evergreen-tools @ git+ssh://[email protected]/mongodb-labs/drivers-evergreen-tools@master",
8888
"docs @ git+ssh://[email protected]/mongodb/docs@main",
89+
"docs-sample-apps @ git+ssh://[email protected]/mongodb/docs-sample-apps@main",
8990
"flask-pymongo @ git+ssh://[email protected]/mongodb-labs/flask-pymongo",
9091
"mongo-arrow @ git+ssh://[email protected]/mongodb-labs/mongo-arrow@main",
9192
"mongo-orchestration @ git+ssh://[email protected]/mongodb-labs/mongo-orchestration@master",

templates/app_template/.github/workflows/django.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

templates/app_template/__init__.py-tpl

Whitespace-only changes.

templates/app_template/admin.py-tpl

Lines changed: 0 additions & 3 deletions
This file was deleted.

templates/app_template/apps.py-tpl

Lines changed: 0 additions & 6 deletions
This file was deleted.

templates/app_template/migrations/__init__.py-tpl

Whitespace-only changes.

templates/app_template/models.py-tpl

Lines changed: 0 additions & 3 deletions
This file was deleted.

templates/app_template/templates/app_name.html

Lines changed: 0 additions & 552 deletions
This file was deleted.

0 commit comments

Comments
 (0)