Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

When trying to do a syncdb in Django it fails with the follow traceback. I've tried deleting the schema and creating a clean one. migrate creates the migration but it never creates any of the tables outside of django_migrations. I've also deleted all existing pyc files as a precaution but no luck. It doesn't seem to be creating any of the tables on initial sync. Currently not dealing with any models outside of the core tables created (auth, sessions, etc.)

System check identified some issues:

WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
    HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
System check identified some issues:

WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
    HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
Operations to perform:
  Synchronize unmigrated apps: oauth2_provider, core, django_admin_bootstrapped, rest_framework_swagger, rest_framework, django_admin_bootstrapped_bootstrap3
  Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying sessions.0001_initial... OK
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 533, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 36, in handle_noargs
    if not UserModel._default_manager.exists() and options.get('interactive'):
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 606, in exists
    return self.query.has_results(using=self.db)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 445, in has_results
    return compiler.has_results()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 757, in has_results
    return bool(self.execute_sql(SINGLE))
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 81, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: SELECT (1) AS "a" FROM "auth_user" LIMIT 1
share|improve this question
    
Are you using custom user model or Django default auth.User? – Aamir Adnan Jun 21 at 21:47
    
what's really weird is I made a clean project with the same database and migrate worked properly and created all the tables... so it's something in the existing project.... anyways, the intial project had a lot of bugs least of which is it's django 1.5 so I'm going to screw it and just bring all the code to v1.7 that I have up. – whoisearth Jun 21 at 21:51
2  
I'd recommend upgrading Django version by version. It keeps the changes simple and build upon one another. Going from 1.5 to 1.8, for example, if pretty difficult. Going from 1.5 to 1.6 to 1.7 to 1.8 is much easier, at least for me. – FlipperPA Jun 22 at 0:18
    
Thanks @FlipperPA it ended up being an issue with multiple databases so for the time being I've scrapped secondary databases. – whoisearth Jun 27 at 0:41
    
Cool, glad you got it figured! If you get a chance, type up an answer to your own question so you can help out folks in the future, and I'll upvote it! – FlipperPA Jun 27 at 10:22

1 Answer 1

This error occurs with the multiple databases I had setup with my previous version of django (1.5). The upgrade did not take to the multiple databases with south. Eventually I will have to re-visit this so that I can attempt migrations but in the meantime I have scrapped this. Removing the multiple database instances in my settings.py resolved the issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.