Headmaster Headmaster -4 years ago 119
Python Question

Django Custom User migrate on heroku

I have created a custom User model in Django. Now, I want to run my application on heroku. But I can't run

migrate
, code error:

ValueError: Dependency on app with no migrations


How can I solve this problem?

Full message error

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

Answer Source

I have made migrations locally and add "0001_initial.py" file to git.

Now it works fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download