2017-05-30 29 views
0

我在Django中創建了自定義用戶模型。現在,我想在heroku上運行我的應用程序。但我無法運行migrate,代碼錯誤:Django自定義用戶在heroku上遷移

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 
+0

是否爲該模型類創建遷移文件? –

+0

顯示完整的錯誤,不只是它的一個片段。這裏指的是什麼應用程序? –

回答

1

我有本地製造的遷移和添加 「0001_initial.py」 文件與git。

現在它工作正常。