Skip to content

Migration error in Django 1.7 / Ошибка при выполнении миграций в Django 1.7 #43

Description

@aderugin

Здравствуйте.

Столкнулся с проблемой при использовании вашего модуля в своем приложении.
При выполнении инициализирующей миграции вылетает следующая ошибка:
"AttributeError: 'module' object has no attribute 'NewBase'".

Находил на github'е обсуждение аналогичной проблемы (#41), но решение мне не помогло.

Django 1.7.1
Django-geoip 0.5.1

Полный текст ошибки:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 63, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 17, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 48, in __init__
    self.build_graph()
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 173, in build_graph
    self.load_disk()
  File "/Users/admin/Sites/django/pruma/.venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 103, in load_disk
    migration_module = import_module("%s.%s" % (module_name, migration_name))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/admin/Sites/django/pruma/pruma/migrations/0001_initial.py", line 11, in <module>
    class Migration(migrations.Migration):
  File "/Users/admin/Sites/django/pruma/pruma/migrations/0001_initial.py", line 72, in Migration
    bases=(django.db.models.base.NewBase, models.Model),
AttributeError: 'module' object has no attribute 'NewBase'

Все установленные приложения

Django==1.7.1
MySQL-python==1.2.5
Pillow==2.6.1
Unidecode==0.04.16
django-ajax-selects==1.3.5
django-appconf==0.6
django-ckeditor==4.4.6
django-compressor==1.4
django-extensions==1.4.6
django-geoip==0.5.1
django-haystack==2.3.1
django-mptt==0.6.1
django-sphinx==4.0.1
django-ulogin==0.2
mock==1.0.1
psycopg2==2.5.4
requests==2.4.3
six==1.8.0
sphinxit==0.3.2
wsgiref==0.1.2
xapian-haystack==2.0.0

Файл миграции

...
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('is_default', models.BooleanField(default=False, help_text='\u0411\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0435\u0441\u043b\u0438 \u0433\u043e\u0440\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d', verbose_name='\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e')),
                ('is_active', models.BooleanField(default=True, verbose_name='\u0410\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c')),
                ('name', models.CharField(help_text='\u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0431\u0443\u0440\u0433, \u0421\u0432\u0435\u0440\u0434\u043b\u043e\u0432\u0441\u043a\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0438 \u0442.\u0434.', unique=True, max_length=128, verbose_name='\u0418\u043c\u044f \u043b\u043e\u043a\u0430\u0446\u0438\u0438')),
                ('phone', models.CharField(default='', max_length=64, verbose_name='\u0422\u0435\u043b\u0435\u0444\u043e\u043d', blank=True)),
                ('email', models.EmailField(default='', max_length=64, verbose_name='Email', blank=True)),
                ('footer_contacts', models.TextField(verbose_name='\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u0432 \u0444\u0443\u0442\u0435\u0440\u0435', blank=True)),
                ('city', models.ManyToManyField(related_name='location_city', verbose_name='\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043a \u0433\u043e\u0440\u043e\u0434\u0430\u043c', to='django_geoip.City')),
                ('region', models.ManyToManyField(related_name='location_region', verbose_name='\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043a \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u043c', to='django_geoip.Region')),
                ('site', models.ForeignKey(verbose_name='\u0421\u0430\u0439\u0442', to='sites.Site', help_text='\u0421\u0430\u0439\u0442, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u0442\u043d\u0435\u0441\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u0430\u044f \u043b\u043e\u043a\u0430\u0446\u0438\u044f')),
            ],
            options={
                'verbose_name': '\u041b\u043e\u043a\u0430\u0446\u0438\u044f',
                'verbose_name_plural': '\u041b\u043e\u043a\u0430\u0446\u0438\u0438',
            },
            bases=(django.db.models.base.NewBase, models.Model),
        ),
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions