Skip to content

Add dm cli + docs #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.envrc
.idea/
backend/
frontend/
django_mongodb_cli.egg-info/
__pycache__
manage.py
mongo_app/
mongo_migrations/
mongo_project/
node_modules/
server.log
server.pid
.babelrc
.browserslistrc
.eslintrc
.nvmrc
.stylelintrc.json
frontend/
package-lock.json
package.json
postcss.config.js
apps/
!test/apps/
src/
!project_templates/project_template/mongo_migrations
home/
.dockerignore
Dockerfile
requirements.txt
search/
uv.lock
docs/_build/
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=5000']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/djlint/djLint
rev: v1.36.3
hooks:
- id: djlint-reformat-django
- id: djlint-django
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.13"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally, but recommended,
# declare the Python requirements required to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# django-mongodb-cli

## About

For testing [django-mongodb-backend](https://github.com/mongodb-labs/django-mongodb-backend)
with [MongoDB's Django fork](https://github.com/mongodb-forks/django) and [third party libraries](#third-party-libraries).

> [!NOTE]
> [MongoDB's Django fork](https://github.com/mongodb-forks/django) is for *testing* [django-mongodb-backend](https://github.com/mongodb-labs/django-mongodb-backend)
> and is not a requirement for *using* [django-mongodb-backend](https://github.com/mongodb-labs/django-mongodb-backend).

## Installation

```bash
git clone https://github.com/mongodb-labs/django-mongodb-cli
cd django-mongodb-cli
python -m venv .venv
source .venv/bin/activate
just install
```

## Usage

```
Usage: dm [OPTIONS] COMMAND [ARGS]...

Django MongoDB CLI

Options:
--help Show this message and exit.

Commands:
repo Run Django fork and third-party library tests.
startproject Run `startproject` with custom templates.
```
40 changes: 40 additions & 0 deletions config/allauth/allauth_apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from django.contrib.admin.apps import AdminConfig
from django.contrib.auth.apps import AuthConfig
from django.contrib.contenttypes.apps import ContentTypesConfig
from allauth.account.apps import AccountConfig
from allauth.socialaccount.apps import SocialAccountConfig
from allauth.usersessions.apps import UserSessionsConfig
from allauth.mfa.apps import MFAConfig
from allauth.headless.apps import HeadlessConfig


class MongoAdminConfig(AdminConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoAuthConfig(AuthConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoContentTypesConfig(ContentTypesConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoHeadlessConfig(HeadlessConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoMFAConfig(MFAConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoUserSessionsConfig(UserSessionsConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoAccountConfig(AccountConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"


class MongoSocialAccountConfig(SocialAccountConfig):
default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"
Loading