1

我在将百日草博客应用程序添加到现有的 django 应用程序时遇到了一些问题。已经几天没有结果了,所以我对任何和所有想法都持开放态度。

我在 python 3.4.0 django 1.7.5 上遇到了与此github 问题类似的错误。这是迁移的输出:

(project)username@computername:~/project/application$ python manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: bootstrap3
  Apply all migrations: project, activity, zinnia, sessions, auth, badge, admin, coupon, contenttypes, sites
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations: Applying zinnia.0001_initial...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 161, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/db/migrations/executor.py", line 68, in migrate
    self.apply_migration(migration, fake=fake)
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/db/migrations/executor.py", line 96, in apply_migration
    if self.detect_soft_applied(migration):
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/db/migrations/executor.py", line 140, in detect_soft_applied
    apps = project_state.render()
  File "/home/username/.virtualenvs/project/local/lib/python3.4/site-packages/django/db/migrations/state.py", line 75, in render
    "for more" % new_unrendered_models
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'zinnia.Author'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more

同样,我使用的是 python 3.4.0 django 1.7.5 和最新版本的百日草 (0.15.1)。

这是我的 pip freeze 的输出:(正如我所说,它是一个现有的应用程序,所以我为它安装了其他软件包)

beautifulsoup4==4.3.2
Django==1.7.5
django-blog-zinnia==0.15.1
django-bootstrap3==5.1.1
django-braces==1.4.0
django-contrib-comments==1.5
django-mptt==0.6.1
django-tagging==0.3.4
django-xmlrpc==0.1.5
enum34==1.0.4
flake8==2.3.0
ipaddress==1.0.7
ipython==3.0.0
isort==3.9.6
jedi==0.8.1
mccabe==0.3
mots-vides==2015.2.6
natsort==3.5.2
pathlib==1.0.1
pbr==0.10.7
pep8==1.6.2
pep8-naming==0.2.2
pies==2.6.3
Pillow==2.7.0
psycopg2==2.6
pyflakes==0.8.1
pyparsing==2.0.3
python3-memcached==1.51
pytz==2014.10
raven==5.2.0
requests==2.5.3
six==1.9.0
stevedore==1.2.0
virtualenv==12.0.7
virtualenv-clone==0.2.5
virtualenvwrapper==4.3.2

编辑:我觉得这与我的应用程序中的模型有关,from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager 但我无法想象不在我的应用程序中使用它。也许是时候寻找另一个博客包了。

4

0 回答 0