django-rest-auth icon indicating copy to clipboard operation
django-rest-auth copied to clipboard

v0.9.3 leads to ERROR: relation "django_site" does not exist

Open DusanMadar opened this issue 7 years ago • 4 comments

On an existing application running tests with v0.9.2 and v0.9.3 gives different results.

No other changes apart from upgrading django-rest-auth were made.

I have django-rest-auth[with_social]~=0.9.2 in requirements.txt.

/my_project # python3 manage.py test
Creating test database for alias 'default'...

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "django_site" does not exist


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 52, in <module>
    execute_from_command_line(args)
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.6/site-packages/django/core/management/commands/test.py", line 29, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/usr/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3.6/site-packages/django/core/management/commands/test.py", line 62, in handle
    failures = test_runner.run_tests(test_labels)
  File "/usr/lib/python3.6/site-packages/snapshottest/django.py", line 30, in run_tests
    **kwargs
  File "/usr/lib/python3.6/site-packages/django/test/runner.py", line 601, in run_tests
    old_config = self.setup_databases()
  File "/usr/lib/python3.6/site-packages/django/test/runner.py", line 546, in setup_databases
    self.parallel, **kwargs
  File "/usr/lib/python3.6/site-packages/django/test/utils.py", line 187, in setup_databases
    serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/creation.py", line 69, in create_test_db
    run_syncdb=True,
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/usr/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 173, in handle
    self.sync_apps(connection, executor.loader.unmigrated_apps)
  File "/usr/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 311, in sync_apps
    self.stdout.write("    Running deferred SQL...\n")
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 93, in __exit__
    self.execute(sql)
  File "/usr/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 120, in execute
    cursor.execute(sql, params)
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "django_site" does not exist

Reverting to v0.9.2 fixed this.

DusanMadar avatar Jan 22 '18 09:01 DusanMadar

Downgrading to 0.9.2 fixed the issue.

pip install django-rest-auth[with_social]==0.9.2

PythonicNinja avatar Jan 22 '18 11:01 PythonicNinja

Thank you so much @PythonicNinja

humatios avatar Apr 13 '18 14:04 humatios

Yup, I am facing the exact same issue, and as such fixated the version to 0.9.2. Any idea why this might be happening?

cansin avatar Feb 25 '22 01:02 cansin

Ah, for anyone who might end up here, https://github.com/pennersr/django-allauth/issues/1817#issuecomment-416016374 fixed the issue for me.

cansin avatar Feb 25 '22 01:02 cansin