Django自定义用户在heroku上迁移

时间:2017-05-30 08:29:06

标签: python django heroku

我在Django中创建了一个自定义用户模型。现在,我想在heroku上运行我的应用程序。但我无法运行migrate,代码错误:

ValueError: Dependency on app with no migrations

我该如何解决这个问题?

完整邮件错误

  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, 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 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 83, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 52, in __init__
    self.build_graph()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 223, in build_graph
    self.add_external_dependencies(key, migration)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 188, in add_external_dependencies
    parent = self.check_key(parent, key[0])
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/migrations/loader.py", line 169, in check_key
    raise ValueError("Dependency on app with no migrations: %s" % key[0])
ValueError: Dependency on app with no migrations: main_site

1 个答案:

答案 0 :(得分:1)

我已在本地进行迁移并添加&#34; var pos = 0; var function = getPos(){ var getPosDfd = $.Deferred(); jQuery.ajax({ url: wpws_ajaxurl, type: "POST", dataType: 'json', cache: false, data: { action: 'getData', key: theWebinarId }, success: function(pos){ getPosDfd.resolve(); pos = JSON.parse(pos) }, error: function (jqXHR, text, status) { getPosDfd.reject(); alert(JSON.stringify(jqXHR) + " Error"); } }); return getPosDfd.promise(); } &#34;归档为git。

现在工作正常。