diff --git a/mongo_migrations/admin/0001_initial.py b/mongo_migrations/admin/0001_initial.py index 76bffbc..ad9173f 100644 --- a/mongo_migrations/admin/0001_initial.py +++ b/mongo_migrations/admin/0001_initial.py @@ -3,7 +3,7 @@ import django.contrib.admin.models import django.db.models.deletion import django.utils.timezone -import django_mongodb.fields.auto +import django_mongodb_backend.fields.auto from django.conf import settings from django.db import migrations, models @@ -21,7 +21,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='LogEntry', fields=[ - ('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, 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')), diff --git a/mongo_migrations/auth/0001_initial.py b/mongo_migrations/auth/0001_initial.py index 74a9fc0..960696d 100644 --- a/mongo_migrations/auth/0001_initial.py +++ b/mongo_migrations/auth/0001_initial.py @@ -4,7 +4,7 @@ import django.contrib.auth.validators import django.db.models.deletion import django.utils.timezone -import django_mongodb.fields.auto +import django_mongodb_backend.fields.auto from django.db import migrations, models @@ -20,7 +20,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Permission', fields=[ - ('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, 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')), @@ -38,7 +38,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Group', fields=[ - ('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, 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')), ], @@ -53,7 +53,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='User', fields=[ - ('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, 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')), diff --git a/mongo_migrations/contenttypes/0001_initial.py b/mongo_migrations/contenttypes/0001_initial.py index e5984e2..d2f6649 100644 --- a/mongo_migrations/contenttypes/0001_initial.py +++ b/mongo_migrations/contenttypes/0001_initial.py @@ -1,7 +1,7 @@ # Generated by Django 5.0.9 on 2024-10-04 20:15 import django.contrib.contenttypes.models -import django_mongodb.fields.auto +import django_mongodb_backend.fields.auto from django.db import migrations, models @@ -16,7 +16,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='ContentType', fields=[ - ('id', django_mongodb.fields.ObjectIdAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', django_mongodb_backend.fields.ObjectIdAutoField(auto_created=True, 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')), ], diff --git a/project_name/apps.py-tpl b/project_name/apps.py-tpl index 214cae8..af80dbc 100644 --- a/project_name/apps.py-tpl +++ b/project_name/apps.py-tpl @@ -4,12 +4,12 @@ from django.contrib.contenttypes.apps import ContentTypesConfig class MongoAdminConfig(AdminConfig): - default_auto_field = "django_mongodb.fields.ObjectIdAutoField" + default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField" class MongoAuthConfig(AuthConfig): - default_auto_field = "django_mongodb.fields.ObjectIdAutoField" + default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField" class MongoContentTypesConfig(ContentTypesConfig): - default_auto_field = "django_mongodb.fields.ObjectIdAutoField" + default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField" diff --git a/project_name/settings.py-tpl b/project_name/settings.py-tpl index e40c829..3a90b69 100644 --- a/project_name/settings.py-tpl +++ b/project_name/settings.py-tpl @@ -10,7 +10,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/ """ -import django_mongodb +import django_mongodb_backend from pathlib import Path @@ -75,8 +75,9 @@ WSGI_APPLICATION = '{{ project_name }}.wsgi.application' # Database # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases -DATABASES = {} -DATABASES["default"] = django_mongodb.parse_uri("mongodb://localhost:27017/{{ project_name }}") +DATABASES = { + "default": django_mongodb_backend.parse_uri("mongodb://localhost:27017/{{ project_name }}"), +} # Password validation # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#auth-password-validators @@ -117,7 +118,7 @@ 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' +DEFAULT_AUTO_FIELD = 'django_mongodb_backend.fields.ObjectIdAutoField' MIGRATION_MODULES = { 'admin': 'mongo_migrations.admin',