title: Django - No such table: main.auth_user__old
body: <p>I was following the <a href="https://docs.djangoproject.com/en/2.1/intro/tutorial01/" rel="noreferrer">first app tutorial</a> from the official Django docs and got this error when trying to save some changes made through the admin page. I did some research on it, but the possible solutions I was able to find, such as migrating the db, simply won't work. Just let me know if you want to see some specific part of my code.</p>
  
  <p>Following is error:</p>
  
  <blockquote>
    <p>OperationalError at /admin/polls/question/1/change/ no such table:
    main.auth_user__old Request Method:   POST Request
    URL:  <a href="http://127.0.0.1:8000/admin/polls/question/1/change/" rel="noreferrer">http://127.0.0.1:8000/admin/polls/question/1/change/</a> Django
    Version:  2.1.4 Exception Type:   OperationalError Exception Value:    no
    such table: main.auth_user__old Exception
    Location: /Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py
    in execute, line 296 Python
    Executable:   /Users/gfioravante/Projects/test_app/ta_env/bin/python3
    Python Version:   3.7.1 Python Path:<br>
    ['/Users/gfioravante/Projects/test_app/test_app', 
    '/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python37.zip',
    '/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7',
    '/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload',
    '/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages']
    Server time:  Wed, 5 Dec 2018 16:45:00 +0000</p>
  </blockquote>
  
  <p>and the traceback:</p>
  
  <blockquote>
    <p>Environment:</p>
    
    <p>Request Method: POST Request URL:
    <a href="http://127.0.0.1:8000/admin/polls/question/1/change/" rel="noreferrer">http://127.0.0.1:8000/admin/polls/question/1/change/</a></p>
    
    <p>Django Version: 2.1.4 Python Version: 3.7.1 Installed Applications:
    ['polls.apps.PollsConfig',  'django.contrib.admin', 
    'django.contrib.auth',  'django.contrib.contenttypes', 
    'django.contrib.sessions',  'django.contrib.messages', 
    'django.contrib.staticfiles'] Installed Middleware:
    ['django.middleware.security.SecurityMiddleware', 
    'django.contrib.sessions.middleware.SessionMiddleware', 
    'django.middleware.common.CommonMiddleware', 
    'django.middleware.csrf.CsrfViewMiddleware', 
    'django.contrib.auth.middleware.AuthenticationMiddleware', 
    'django.contrib.messages.middleware.MessageMiddleware', 
    'django.middleware.clickjacking.XFrameOptionsMiddleware']</p>
    
    <p>Traceback:</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/utils.py"
    in _execute
      85.                 return self.cursor.execute(sql, params)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py"
    in execute
      296.         return Database.Cursor.execute(self, query, params)</p>
    
    <p>The above exception (no such table: main.auth_user__old) was the
    direct cause of the following exception:</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/core/handlers/exception.py"
    in inner
      34.             response = get_response(request)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/core/handlers/base.py"
    in _get_response
      126.                 response = self.process_exception_by_middleware(e, request)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/core/handlers/base.py"
    in _get_response
      124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/contrib/admin/options.py"
    in wrapper
      604.                 return self.admin_site.admin_view(view)(*args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/utils/decorators.py"
    in _wrapped_view
      142.                     response = view_func(request, *args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/views/decorators/cache.py"
    in _wrapped_view_func
      44.         response = view_func(request, *args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/contrib/admin/sites.py" in inner
      223.             return view(request, *args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/contrib/admin/options.py"
    in change_view
      1640.         return self.changeform_view(request, object_id, form_url, extra_context)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/utils/decorators.py"
    in _wrapper
      45.         return bound_method(*args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/utils/decorators.py"
    in _wrapped_view
      142.                     response = view_func(request, *args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/contrib/admin/options.py"
    in changeform_view
      1525.             return self._changeform_view(request, object_id, form_url, extra_context)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/contrib/admin/options.py"
    in _changeform_view
      1571.                     self.log_change(request, new_object, change_message)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/contrib/admin/options.py"
    in log_change
      826.             change_message=message,</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/contrib/admin/models.py"
    in log_action
      35.             change_message=change_message,</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/manager.py"
    in manager_method
      82.                 return getattr(self.get_queryset(), name)(*args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/query.py"
    in create
      413.         obj.save(force_insert=True, using=self.db)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/base.py"
    in save
      718.                        force_update=force_update, update_fields=update_fields)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/base.py"
    in save_base
      748.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/base.py"
    in _save_table
      831.             result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/base.py"
    in _do_insert
      869.                                using=using, raw=raw)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/manager.py"
    in manager_method
      82.                 return getattr(self.get_queryset(), name)(*args, **kwargs)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/query.py"
    in _insert
      1136.         return query.get_compiler(using=using).execute_sql(return_id)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/models/sql/compiler.py"
    in execute_sql
      1289.                 cursor.execute(sql, params)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/utils.py"
    in execute
      100.             return super().execute(sql, params)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/utils.py"
    in execute
      68.         return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/utils.py"
    in _execute_with_wrappers
      77.         return executor(sql, params, many, context)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/utils.py"
    in _execute
      85.                 return self.cursor.execute(sql, params)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/utils.py"
    in <strong>exit</strong>
      89.                 raise dj_exc_value.with_traceback(traceback) from exc_value</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/utils.py"
    in _execute
      85.                 return self.cursor.execute(sql, params)</p>
    
    <p>File
    "/Users/gfioravante/Projects/test_app/ta_env/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py"
    in execute
      296.         return Database.Cursor.execute(self, query, params)</p>
    
    <p>Exception Type: OperationalError at /admin/polls/question/1/change/
    Exception Value: no such table: main.auth_user__old</p>
  </blockquote>