重命名django中的模型文件后,在迁移文件中找不到模块错误

时间:2016-09-22 15:38:52

标签: python django

我将模型文件从Users.py重命名为users.py。 Makemigrations和迁移工作正常,但是当我尝试运行命令manage.py runserver时,它会抛出错误。

No module named 'accounts.models.Users'

在迁移文件中。

# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-12 16:37
from __future__ import unicode_literals

import accounts.models.Users
from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0004_usermodel_is_active'),
    ]

    operations = [
        migrations.AlterModelManagers(
            name='usermodel',
            managers=[
                ('objects', accounts.models.Users.MyUserManager()),
            ],
        ),
    ]

如何解决此错误?我们不应该更改模型文件名吗?

0 个答案:

没有答案
相关问题