Skip to content

Commit aff6e0c

Browse files
committed
Add dm cli + docs
1 parent fe6d104 commit aff6e0c

37 files changed

+6070
-55
lines changed

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.envrc
2+
.idea/
3+
backend/
4+
frontend/
5+
django_mongodb_cli.egg-info/
6+
__pycache__
7+
manage.py
8+
mongo_app/
9+
mongo_migrations/
10+
mongo_project/
11+
node_modules/
12+
server.log
13+
server.pid
14+
.babelrc
15+
.browserslistrc
16+
.eslintrc
17+
.nvmrc
18+
.stylelintrc.json
19+
frontend/
20+
package-lock.json
21+
package.json
22+
postcss.config.js
23+
apps/
24+
!test/apps/
25+
src/
26+
!project_templates/project_template/mongo_migrations
27+
home/
28+
.dockerignore
29+
Dockerfile
30+
requirements.txt
31+
search/
32+
uv.lock
33+
docs/_build/

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ repos:
1414
- id: ruff
1515
args: [ --fix ]
1616
- id: ruff-format
17+
18+
- repo: https://github.com/djlint/djLint
19+
rev: v1.36.3
20+
hooks:
21+
- id: djlint-reformat-django
22+
- id: djlint-django

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version, and other tools you might need
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.13"
12+
13+
# Build documentation in the "docs/" directory with Sphinx
14+
sphinx:
15+
configuration: docs/source/conf.py
16+
17+
# Optionally, but recommended,
18+
# declare the Python requirements required to build your documentation
19+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20+
# python:
21+
# install:
22+
# - requirements: docs/requirements.txt

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# django-mongodb-cli
2+
3+
## About
4+
5+
For testing [django-mongodb-backend](https://github.com/mongodb-labs/django-mongodb-backend)
6+
with [MongoDB's Django fork](https://github.com/mongodb-forks/django) and [third party libraries](#third-party-libraries).
7+
8+
> [!NOTE]
9+
> [MongoDB's Django fork](https://github.com/mongodb-forks/django) is for *testing* [django-mongodb-backend](https://github.com/mongodb-labs/django-mongodb-backend)
10+
> and is not a requirement for *using* [django-mongodb-backend](https://github.com/mongodb-labs/django-mongodb-backend).
11+
12+
## Installation
13+
14+
```bash
15+
git clone https://github.com/mongodb-labs/django-mongodb-cli
16+
cd django-mongodb-cli
17+
python -m venv .venv
18+
source .venv/bin/activate
19+
just install
20+
```
21+
22+
## Usage
23+
24+
```
25+
Usage: dm [OPTIONS] COMMAND [ARGS]...
26+
27+
Django MongoDB CLI
28+
29+
Options:
30+
--help Show this message and exit.
31+
32+
Commands:
33+
repo Run Django fork and third-party library tests.
34+
startproject Run `startproject` with custom templates.
35+
```

config/allauth_apps.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from django.contrib.admin.apps import AdminConfig
2+
from django.contrib.auth.apps import AuthConfig
3+
from django.contrib.contenttypes.apps import ContentTypesConfig
4+
from allauth.account.apps import AccountConfig
5+
from allauth.socialaccount.apps import SocialAccountConfig
6+
from allauth.usersessions.apps import UserSessionsConfig
7+
from allauth.mfa.apps import MFAConfig
8+
from allauth.headless.apps import HeadlessConfig
9+
10+
11+
class MongoAdminConfig(AdminConfig):
12+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
13+
14+
15+
class MongoAuthConfig(AuthConfig):
16+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
17+
18+
19+
class MongoContentTypesConfig(ContentTypesConfig):
20+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
21+
22+
23+
class MongoHeadlessConfig(HeadlessConfig):
24+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
25+
26+
27+
class MongoMFAConfig(MFAConfig):
28+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
29+
30+
31+
class MongoUserSessionsConfig(UserSessionsConfig):
32+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
33+
34+
35+
class MongoAccountConfig(AccountConfig):
36+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
37+
38+
39+
class MongoSocialAccountConfig(SocialAccountConfig):
40+
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"

0 commit comments

Comments
 (0)