Closed Prashant4900 closed 2 years ago
Hi @Prashant4900
This appears to be a problem in migration files.
Can you include that initial migration from your accounts app? It must be causing the issue with filer
@marksweb Here is the migration file
# Generated by Django 4.0.5 on 2022-06-11 13:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import filer.fields.image
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.FILER_IMAGE_MODEL),
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='CustomUser',
fields=[
('id', models.BigAutoField(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')),
('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')),
('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')),
('username', models.CharField(blank=True, max_length=25, null=True, unique=True)),
('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
('date_of_birth', models.DateField(blank=True, null=True)),
('phone', models.CharField(blank=True, max_length=15, null=True)),
('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')),
('photo', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.FILER_IMAGE_MODEL)),
('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',
},
),
]
@Prashant4900 ok, so filer's initial migration depends on the auth initial migration. So your accouts app wants filer to install first and filer wants your accounts app to install first.
To resolve, don't include the filer field on your model until after the first migration. So take the filer field out of the model, create the migration, then add the field back in and create another migration.
@Prashant4900 ok, so filer's initial migration depends on the auth initial migration. So your accouts app wants filer to install first and filer wants your accounts app to install first.
To resolve, don't include the filer field on your model until after the first migration. So take the filer field out of the model, create the migration, then add the field back in and create another migration.
Thanks it's worked
How can I fix that?
Setting.py
Urls.py
Model.py
Exceptions