Django一次又一次地要求我迁移服务器上挂起的迁移?

2024-06-01 00:56:19 发布

您现在位置:Python中文网/ 问答频道 /正文

大家好,我的项目太小了,我只有一个名为accounts的应用程序具有自定义用户模型,我正在尝试将其部署到heroku服务器上。但django向我展示了服务器上的一些奇怪行为。我不知道如何描述我的问题,因为这是一个我以前从未见过的非常奇怪的行为

我正在进行迁移

heroku run python manage.py makemigrations
No changes detected

然后我要迁移它

heroku run python manage.py migrate

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0001_initial... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying sessions.0001_initial... OK

然后我尝试通过

heroku run python manage.py createsuperuser

**You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.        
Run 'python manage.py migrate' to apply them.**

Username: 

您可以看到迁移仍然没有应用……这是什么问题


Tags: runnamepyaddherokumanagemigrationsok