Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4572654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:40:34+00:00 2026-05-21T19:40:34+00:00

I have django.contrib.auth in my installed apps and everything was was working about 10

  • 0

I have django.contrib.auth in my installed apps and everything was was working about 10 minutes ago. I deleted the existed database because I had problems with south migrations. When I try to rebuild it I get an error.

Error: django.db.utils.DatabaseError: no such table: auth_user

Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 219, in execute
    self.validate()
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/usr/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/usr/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/usr/lib/python2.7/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/usr/lib/python2.7/site-packages/django/db/models/loading.py", line 78, in load_app
    models = import_module('.models', app_name)
  File "/usr/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/bruk/workspace/hungryDroid/src/hungryDroid/Ingredient/models.py", line 22, in <module>
    class Ingredient(models.Model):
  File "/home/bruk/workspace/hungryDroid/src/hungryDroid/Ingredient/models.py", line 26, in Ingredient
    FKowner = models.ForeignKey(User, default=User.objects.get(pk=1).id)
  File "/usr/lib/python2.7/site-packages/django/db/models/manager.py", line 132, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 342, in get
    num = len(clone)
  File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 80, in __len__
    self._result_cache = list(self.iterator())
  File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 271, in iterator
    for row in compiler.results_iter():
  File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 677, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 732, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", line 15, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 200, in execute
    return Database.Cursor.execute(self, query, params)
**django.db.utils.DatabaseError: no such table: auth_user**
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T19:40:34+00:00Added an answer on May 21, 2026 at 7:40 pm

    The problem is that you are running a query against the User model

      File "/home/bruk/workspace/hungryDroid/src/hungryDroid/Ingredient/models.py", line 26, in Ingredient
    FKowner = models.ForeignKey(User, default=User.objects.get(pk=1).id)
    

    In the syncdb process (during field declaration actually, so any time your module is imported, like during this validation process).

    This will make sure that the auth_user query is executed before the auth_user table is created.

    A safer way to get the functionality with the default user is to do

    def get_default_user():
        return User.objects.get(pk=1)
    

    And then in your field declaration, do

    FKowner = models.ForeignKey(User, default=get_default_user)
    

    As per the model field reference default can be a callable. Note that you would have the same problem if you used get_default_user() in there – then it executes immediately, not on-demand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem getting password_Reset_confirm bit working. url: (r'^password_reset/$', 'django.contrib.auth.views.password_reset'), (r'^password_reset_done/$', 'django.contrib.auth.views.password_reset_done'), (r'^password_reset_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
I have a form like so: from django import forms from django.contrib.auth.models import User
I have this urls on urls.py url(r'^login/$', 'django.contrib.auth.views.login', {'template_name':'login.html'}), url(r'^(one|two)/logout/$', 'django.contrib.auth.views.logout_then_login', {'login_url':'/login/'}) I'm trying
Basically, I currently have login/ in urls.py redirect to the django.contrib.auth.views.login and that seems
i have django installed and seems to be working it worked page I want
I have inserted this in settings.py: AUTHENTICATION_BACKENDS = ( 'blog.auth.backends.EmailBackend', 'django.contrib.auth.backends.ModelBackend', ) blog is
I use the django comments from contrib and I have an object (entry) that
I have ceated several django apps and stuffs for my own fun and so
I have installed and configured django-postman based on documentation : in urls.py in root
I have installed django-registration with pip, version 0.7. Then with urls.py from core.forms import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.