From 69095306c2c528d11b3726775dd5536067cd93ad Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Fri, 4 Oct 2024 08:50:40 -0400 Subject: [PATCH 1/6] Add templates --- app_template/__init__.py-tpl | 0 app_template/admin.py-tpl | 3 + app_template/apps.py-tpl | 6 + app_template/migrations/__init__.py-tpl | 0 app_template/models.py-tpl | 3 + app_template/tests.py-tpl | 3 + app_template/views.py-tpl | 3 + project_template/manage.py-tpl | 22 +++ project_template/project_name/__init__.py-tpl | 0 project_template/project_name/apps.py-tpl | 15 ++ project_template/project_name/asgi.py-tpl | 16 +++ project_template/project_name/settings.py-tpl | 131 ++++++++++++++++++ project_template/project_name/urls.py-tpl | 22 +++ project_template/project_name/wsgi.py-tpl | 16 +++ 14 files changed, 240 insertions(+) create mode 100644 app_template/__init__.py-tpl create mode 100644 app_template/admin.py-tpl create mode 100644 app_template/apps.py-tpl create mode 100644 app_template/migrations/__init__.py-tpl create mode 100644 app_template/models.py-tpl create mode 100644 app_template/tests.py-tpl create mode 100644 app_template/views.py-tpl create mode 100755 project_template/manage.py-tpl create mode 100644 project_template/project_name/__init__.py-tpl create mode 100644 project_template/project_name/apps.py-tpl create mode 100644 project_template/project_name/asgi.py-tpl create mode 100644 project_template/project_name/settings.py-tpl create mode 100644 project_template/project_name/urls.py-tpl create mode 100644 project_template/project_name/wsgi.py-tpl diff --git a/app_template/__init__.py-tpl b/app_template/__init__.py-tpl new file mode 100644 index 0000000..e69de29 diff --git a/app_template/admin.py-tpl b/app_template/admin.py-tpl new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/app_template/admin.py-tpl @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/app_template/apps.py-tpl b/app_template/apps.py-tpl new file mode 100644 index 0000000..1f5ce78 --- /dev/null +++ b/app_template/apps.py-tpl @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class {{ camel_case_app_name }}Config(AppConfig): + default_auto_field = 'django_mongodb.fields.ObjectIdAutoField' + name = '{{ app_name }}' diff --git a/app_template/migrations/__init__.py-tpl b/app_template/migrations/__init__.py-tpl new file mode 100644 index 0000000..e69de29 diff --git a/app_template/models.py-tpl b/app_template/models.py-tpl new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/app_template/models.py-tpl @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/app_template/tests.py-tpl b/app_template/tests.py-tpl new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/app_template/tests.py-tpl @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/app_template/views.py-tpl b/app_template/views.py-tpl new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/app_template/views.py-tpl @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/project_template/manage.py-tpl b/project_template/manage.py-tpl new file mode 100755 index 0000000..a628884 --- /dev/null +++ b/project_template/manage.py-tpl @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/project_template/project_name/__init__.py-tpl b/project_template/project_name/__init__.py-tpl new file mode 100644 index 0000000..e69de29 diff --git a/project_template/project_name/apps.py-tpl b/project_template/project_name/apps.py-tpl new file mode 100644 index 0000000..214cae8 --- /dev/null +++ b/project_template/project_name/apps.py-tpl @@ -0,0 +1,15 @@ +from django.contrib.admin.apps import AdminConfig +from django.contrib.auth.apps import AuthConfig +from django.contrib.contenttypes.apps import ContentTypesConfig + + +class MongoAdminConfig(AdminConfig): + default_auto_field = "django_mongodb.fields.ObjectIdAutoField" + + +class MongoAuthConfig(AuthConfig): + default_auto_field = "django_mongodb.fields.ObjectIdAutoField" + + +class MongoContentTypesConfig(ContentTypesConfig): + default_auto_field = "django_mongodb.fields.ObjectIdAutoField" diff --git a/project_template/project_name/asgi.py-tpl b/project_template/project_name/asgi.py-tpl new file mode 100644 index 0000000..a827238 --- /dev/null +++ b/project_template/project_name/asgi.py-tpl @@ -0,0 +1,16 @@ +""" +ASGI config for {{ project_name }} project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings') + +application = get_asgi_application() diff --git a/project_template/project_name/settings.py-tpl b/project_template/project_name/settings.py-tpl new file mode 100644 index 0000000..8f993c0 --- /dev/null +++ b/project_template/project_name/settings.py-tpl @@ -0,0 +1,131 @@ +""" +Django settings for {{ project_name }} project. + +Generated by 'django-admin startproject' using Django {{ django_version }}. + +For more information on this file, see +https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '{{ secret_key }}' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + '{{ project_name }}.apps.MongoAdminConfig', + '{{ project_name }}.apps.MongoAuthConfig', + '{{ project_name }}.apps.MongoContentTypesConfig', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = '{{ project_name }}.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = '{{ project_name }}.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases + +DATABASES = { + "default": { + "ENGINE": "django_mongodb", + "NAME": "my_database", + # "USER": "my_username", + # "PASSWORD": "my_password", + # "OPTIONS": {...}, + }, +} + +# Password validation +# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django_mongodb.fields.ObjectIdAutoField' + +MIGRATION_MODULES = { + 'admin': '{{ project_name }}.mongo_migrations.admin', + 'auth': '{{ project_name }}.mongo_migrations.auth', + 'contenttypes': '{{ project_name }}.mongo_migrations.contenttypes', +} diff --git a/project_template/project_name/urls.py-tpl b/project_template/project_name/urls.py-tpl new file mode 100644 index 0000000..622f79e --- /dev/null +++ b/project_template/project_name/urls.py-tpl @@ -0,0 +1,22 @@ +""" +URL configuration for {{ project_name }} project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/project_template/project_name/wsgi.py-tpl b/project_template/project_name/wsgi.py-tpl new file mode 100644 index 0000000..1ee28d0 --- /dev/null +++ b/project_template/project_name/wsgi.py-tpl @@ -0,0 +1,16 @@ +""" +WSGI config for {{ project_name }} project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings') + +application = get_wsgi_application() From 78aa70a0660399ff10a21e12335c22b9eeea6a0e Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Fri, 4 Oct 2024 08:56:30 -0400 Subject: [PATCH 2/6] Move app templates to separate repo --- app_template/__init__.py-tpl | 0 app_template/admin.py-tpl | 3 --- app_template/apps.py-tpl | 6 ------ app_template/migrations/__init__.py-tpl | 0 app_template/models.py-tpl | 3 --- app_template/tests.py-tpl | 3 --- app_template/views.py-tpl | 3 --- 7 files changed, 18 deletions(-) delete mode 100644 app_template/__init__.py-tpl delete mode 100644 app_template/admin.py-tpl delete mode 100644 app_template/apps.py-tpl delete mode 100644 app_template/migrations/__init__.py-tpl delete mode 100644 app_template/models.py-tpl delete mode 100644 app_template/tests.py-tpl delete mode 100644 app_template/views.py-tpl diff --git a/app_template/__init__.py-tpl b/app_template/__init__.py-tpl deleted file mode 100644 index e69de29..0000000 diff --git a/app_template/admin.py-tpl b/app_template/admin.py-tpl deleted file mode 100644 index 8c38f3f..0000000 --- a/app_template/admin.py-tpl +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/app_template/apps.py-tpl b/app_template/apps.py-tpl deleted file mode 100644 index 1f5ce78..0000000 --- a/app_template/apps.py-tpl +++ /dev/null @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class {{ camel_case_app_name }}Config(AppConfig): - default_auto_field = 'django_mongodb.fields.ObjectIdAutoField' - name = '{{ app_name }}' diff --git a/app_template/migrations/__init__.py-tpl b/app_template/migrations/__init__.py-tpl deleted file mode 100644 index e69de29..0000000 diff --git a/app_template/models.py-tpl b/app_template/models.py-tpl deleted file mode 100644 index 71a8362..0000000 --- a/app_template/models.py-tpl +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/app_template/tests.py-tpl b/app_template/tests.py-tpl deleted file mode 100644 index 7ce503c..0000000 --- a/app_template/tests.py-tpl +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/app_template/views.py-tpl b/app_template/views.py-tpl deleted file mode 100644 index 91ea44a..0000000 --- a/app_template/views.py-tpl +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. From cc8a11031fc56e5685d561d4d8209b8cc5227b08 Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Fri, 4 Oct 2024 15:59:19 -0400 Subject: [PATCH 3/6] Move * .. --- project_template/manage.py-tpl => manage.py-tpl | 0 {project_template/project_name => project_name}/__init__.py-tpl | 0 {project_template/project_name => project_name}/apps.py-tpl | 0 {project_template/project_name => project_name}/asgi.py-tpl | 0 {project_template/project_name => project_name}/settings.py-tpl | 0 {project_template/project_name => project_name}/urls.py-tpl | 0 {project_template/project_name => project_name}/wsgi.py-tpl | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename project_template/manage.py-tpl => manage.py-tpl (100%) rename {project_template/project_name => project_name}/__init__.py-tpl (100%) rename {project_template/project_name => project_name}/apps.py-tpl (100%) rename {project_template/project_name => project_name}/asgi.py-tpl (100%) rename {project_template/project_name => project_name}/settings.py-tpl (100%) rename {project_template/project_name => project_name}/urls.py-tpl (100%) rename {project_template/project_name => project_name}/wsgi.py-tpl (100%) diff --git a/project_template/manage.py-tpl b/manage.py-tpl similarity index 100% rename from project_template/manage.py-tpl rename to manage.py-tpl diff --git a/project_template/project_name/__init__.py-tpl b/project_name/__init__.py-tpl similarity index 100% rename from project_template/project_name/__init__.py-tpl rename to project_name/__init__.py-tpl diff --git a/project_template/project_name/apps.py-tpl b/project_name/apps.py-tpl similarity index 100% rename from project_template/project_name/apps.py-tpl rename to project_name/apps.py-tpl diff --git a/project_template/project_name/asgi.py-tpl b/project_name/asgi.py-tpl similarity index 100% rename from project_template/project_name/asgi.py-tpl rename to project_name/asgi.py-tpl diff --git a/project_template/project_name/settings.py-tpl b/project_name/settings.py-tpl similarity index 100% rename from project_template/project_name/settings.py-tpl rename to project_name/settings.py-tpl diff --git a/project_template/project_name/urls.py-tpl b/project_name/urls.py-tpl similarity index 100% rename from project_template/project_name/urls.py-tpl rename to project_name/urls.py-tpl diff --git a/project_template/project_name/wsgi.py-tpl b/project_name/wsgi.py-tpl similarity index 100% rename from project_template/project_name/wsgi.py-tpl rename to project_name/wsgi.py-tpl From bc1d55d79fbf6b6b23a767397cc1ba01c264e37c Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Fri, 4 Oct 2024 16:09:23 -0400 Subject: [PATCH 4/6] Move mongo_migrations .. --- project_name/settings.py-tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project_name/settings.py-tpl b/project_name/settings.py-tpl index 8f993c0..cba377d 100644 --- a/project_name/settings.py-tpl +++ b/project_name/settings.py-tpl @@ -125,7 +125,7 @@ STATIC_URL = 'static/' DEFAULT_AUTO_FIELD = 'django_mongodb.fields.ObjectIdAutoField' MIGRATION_MODULES = { - 'admin': '{{ project_name }}.mongo_migrations.admin', - 'auth': '{{ project_name }}.mongo_migrations.auth', - 'contenttypes': '{{ project_name }}.mongo_migrations.contenttypes', + 'admin': 'mongo_migrations.admin', + 'auth': 'mongo_migrations.auth', + 'contenttypes': 'mongo_migrations.contenttypes', } From 374fb50fd45a0104b4c9b3135d8680a225c4edbd Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Fri, 4 Oct 2024 16:14:19 -0400 Subject: [PATCH 5/6] Add mongo_migrations --- mongo_migrations/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 mongo_migrations/__init__.py diff --git a/mongo_migrations/__init__.py b/mongo_migrations/__init__.py new file mode 100644 index 0000000..e69de29 From 93bb742aecf5cc708207f0d0faa2353356d996aa Mon Sep 17 00:00:00 2001 From: "Jeffrey A. Clark" Date: Fri, 4 Oct 2024 16:17:41 -0400 Subject: [PATCH 6/6] Add mongo_migrations --- mongo_migrations/admin/0001_initial.py | 43 ++++++++++ mongo_migrations/admin/__init__.py | 0 mongo_migrations/auth/0001_initial.py | 80 +++++++++++++++++++ mongo_migrations/auth/__init__.py | 0 mongo_migrations/contenttypes/0001_initial.py | 33 ++++++++ mongo_migrations/contenttypes/__init__.py | 0 6 files changed, 156 insertions(+) create mode 100644 mongo_migrations/admin/0001_initial.py create mode 100644 mongo_migrations/admin/__init__.py create mode 100644 mongo_migrations/auth/0001_initial.py create mode 100644 mongo_migrations/auth/__init__.py create mode 100644 mongo_migrations/contenttypes/0001_initial.py create mode 100644 mongo_migrations/contenttypes/__init__.py diff --git a/mongo_migrations/admin/0001_initial.py b/mongo_migrations/admin/0001_initial.py new file mode 100644 index 0000000..c335648 --- /dev/null +++ b/mongo_migrations/admin/0001_initial.py @@ -0,0 +1,43 @@ +# Generated by Django 5.0.9 on 2024-10-04 20:15 + +import django.contrib.admin.models +import django.db.models.deletion +import django.utils.timezone +import django_mongodb.fields.auto +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('contenttypes', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='LogEntry', + fields=[ + ('id', django_mongodb.fields.auto.ObjectIdAutoField(auto_created=True, db_column='_id', primary_key=True, serialize=False, verbose_name='ID')), + ('action_time', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='action time')), + ('object_id', models.TextField(blank=True, null=True, verbose_name='object id')), + ('object_repr', models.CharField(max_length=200, verbose_name='object repr')), + ('action_flag', models.PositiveSmallIntegerField(choices=[(1, 'Addition'), (2, 'Change'), (3, 'Deletion')], verbose_name='action flag')), + ('change_message', models.TextField(blank=True, verbose_name='change message')), + ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='contenttypes.contenttype', verbose_name='content type')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user')), + ], + options={ + 'verbose_name': 'log entry', + 'verbose_name_plural': 'log entries', + 'db_table': 'django_admin_log', + 'ordering': ['-action_time'], + }, + managers=[ + ('objects', django.contrib.admin.models.LogEntryManager()), + ], + ), + ] diff --git a/mongo_migrations/admin/__init__.py b/mongo_migrations/admin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mongo_migrations/auth/0001_initial.py b/mongo_migrations/auth/0001_initial.py new file mode 100644 index 0000000..243bb48 --- /dev/null +++ b/mongo_migrations/auth/0001_initial.py @@ -0,0 +1,80 @@ +# Generated by Django 5.0.9 on 2024-10-04 20:15 + +import django.contrib.auth.models +import django.contrib.auth.validators +import django.db.models.deletion +import django.utils.timezone +import django_mongodb.fields.auto +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('contenttypes', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Permission', + fields=[ + ('id', django_mongodb.fields.auto.ObjectIdAutoField(auto_created=True, db_column='_id', primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('codename', models.CharField(max_length=100, verbose_name='codename')), + ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype', verbose_name='content type')), + ], + options={ + 'verbose_name': 'permission', + 'verbose_name_plural': 'permissions', + 'ordering': ['content_type__app_label', 'content_type__model', 'codename'], + 'unique_together': {('content_type', 'codename')}, + }, + managers=[ + ('objects', django.contrib.auth.models.PermissionManager()), + ], + ), + migrations.CreateModel( + name='Group', + fields=[ + ('id', django_mongodb.fields.auto.ObjectIdAutoField(auto_created=True, db_column='_id', primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=150, unique=True, verbose_name='name')), + ('permissions', models.ManyToManyField(blank=True, to='auth.permission', verbose_name='permissions')), + ], + options={ + 'verbose_name': 'group', + 'verbose_name_plural': 'groups', + }, + managers=[ + ('objects', django.contrib.auth.models.GroupManager()), + ], + ), + migrations.CreateModel( + name='User', + fields=[ + ('id', django_mongodb.fields.auto.ObjectIdAutoField(auto_created=True, db_column='_id', primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), + ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')), + ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), + ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')), + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')), + ], + options={ + 'verbose_name': 'user', + 'verbose_name_plural': 'users', + 'abstract': False, + 'swappable': 'AUTH_USER_MODEL', + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + ] diff --git a/mongo_migrations/auth/__init__.py b/mongo_migrations/auth/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mongo_migrations/contenttypes/0001_initial.py b/mongo_migrations/contenttypes/0001_initial.py new file mode 100644 index 0000000..a05ed95 --- /dev/null +++ b/mongo_migrations/contenttypes/0001_initial.py @@ -0,0 +1,33 @@ +# Generated by Django 5.0.9 on 2024-10-04 20:15 + +import django.contrib.contenttypes.models +import django_mongodb.fields.auto +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='ContentType', + fields=[ + ('id', django_mongodb.fields.auto.ObjectIdAutoField(auto_created=True, db_column='_id', primary_key=True, serialize=False, verbose_name='ID')), + ('app_label', models.CharField(max_length=100)), + ('model', models.CharField(max_length=100, verbose_name='python model class name')), + ], + options={ + 'verbose_name': 'content type', + 'verbose_name_plural': 'content types', + 'db_table': 'django_content_type', + 'unique_together': {('app_label', 'model')}, + }, + managers=[ + ('objects', django.contrib.contenttypes.models.ContentTypeManager()), + ], + ), + ] diff --git a/mongo_migrations/contenttypes/__init__.py b/mongo_migrations/contenttypes/__init__.py new file mode 100644 index 0000000..e69de29