createsupersuser Django fails
I started working on the tutorials and when I try to createsuperuser, i get a stacktrace : Looks like the auth_user table is missing???? I m using out of the box tutorial. What am I doing worng????
Traceback (most recent call last):
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 296, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: auth_user
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pycharm/django_manage.py", line 52, in <module>
run_command()
File "/Applications/PyCharm.app/Contents/helpers/pycharm/django_manage.py", line 46, in run_command
run_module(manage_file, None, '__main__', True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/srimallur/PycharmProjects/RiskICS/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 59, in execute
return super().execute(*args, **options)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 93, in handle
default_username = get_default_username()
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/contrib/auth/management/__init__.py", line 136, in get_default_username
auth_app.User._default_manager.get(username=default_username)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/models/query.py", line 393, in get
num = len(clone)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/models/query.py", line 250, in __len__
self._fetch_all()
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/models/query.py", line 1186, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/models/query.py", line 54, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1065, in execute_sql
cursor.execute(sql, params)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 100, in execute
return super().execute(sql, params)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/Users/srimallur/PycharmProjects/RiskICS/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 296, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_user
Process finished with exit code 1
Please sign in to leave a comment.
nevermind i figured it out....had to run migrate in the terminal....please cancel this request