南迁移错误:NoMigrations

时间:2015-12-14 21:06:42

标签: django database heroku django-south

我是South的新手,我正在尝试执行迁移。它在本地工作正常,但当我将代码推送到Heroku并尝试迁移时,我遇到了这个错误:

    Traceback (most recent call last):
  File "manage.py", line 57, in <module>
    execute_from_command_line()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/app/.heroku/python/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File "/app/.heroku/python/lib/python2.7/site-packages/south/migration/__init__.py", line 200, in migrate_app
    applied_all = check_migration_histories(applied_all, delete_ghosts, ignore_ghosts)
  File "/app/.heroku/python/lib/python2.7/site-packages/south/migration/__init__.py", line 81, in check_migration_histories
    m = h.get_migration()
  File "/app/.heroku/python/lib/python2.7/site-packages/south/models.py", line 34, in get_migration
    return self.get_migrations().migration(self.migration)
  File "/app/.heroku/python/lib/python2.7/site-packages/south/models.py", line 31, in get_migrations
    return Migrations(self.app_name)
  File "/app/.heroku/python/lib/python2.7/site-packages/south/migration/base.py", line 64, in __call__
    self.instances[app_label] = super(MigrationsMetaclass, self).__call__(app_label_to_app_module(app_label), **kwds)
  File "/app/.heroku/python/lib/python2.7/site-packages/south/migration/base.py", line 90, in __init__
    self.set_application(application, force_creation, verbose_creation)
  File "/app/.heroku/python/lib/python2.7/site-packages/south/migration/base.py", line 162, in set_application
    raise exceptions.NoMigrations(application)
south.exceptions.NoMigrations: Application '<module 'django_extensions' from '/app/.heroku/python/lib/python2.7/site-packages/django_extensions/__init__.pyc'>' has no migrations.

在当地我做了:

python manage.py schemamigration spicemodels --auto
python manage.py migrate spicemodels

然后我将迁移文件推送到Heroku并使用以下方式访问应用程序:

heroku run bash --app <app-name>

然后我进入正确的目录并运行:

python manage.py migrate spicemodels

那是我收到上述错误的时候。

0 个答案:

没有答案