Issues with Heroku migrate


#1

Hi there, I made it to the part on migrating Heroku but I ran into some problems. I think my versions could be messed up as I was installing things between venv/local I might have gotten mixed up.

Here is what I’m getting when I run heroku run python manage.py migrate

Running `python manage.py migrate` attached to terminal... up, run.7130
System check identified some issues:

WARNINGS:
registration.RegistrationProfile.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
	HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
Operations to perform:
  Synchronize unmigrated apps: staticfiles, registration, messages, humanize
  Apply all migrations: admin, auth, sessions, collection, contenttypes
Synchronizing apps without migrations:
  Creating tables...
    Creating table registration_registrationprofile
    Running deferred SQL...
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, 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 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 444, in execute
    output = self.handle(*args, **options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 179, in handle
    created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 317, in sync_apps
    cursor.execute(statement)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "auth_user" does not exist

Any help would be great, thank you!


#2

Hmmm — what version of Django are you using? If 1.8, can you try the answer here (http://stackoverflow.com/questions/29689365/auth-user-error-with-django-1-8-and-syncdb-migrate) and let me know if that works or not?


#3

Excellent, that seems to have worked! I’m guessing the OnetoOne thing is not a big deal, but just for my own sake - is there an easy fix for that?


#4

Somehow you have an old version of the book since the current version of Hello Web App has a OnetoOne field. =/ You can just ignore it though.

Mind letting me know where you got your book so I can see if there is an old version floating around out there?


#5

Sure, I got it off Gumroad - PDF version


#6

Thanks! Going to recheck it now. :)