Nitish Kumar Pal
Nitish Kumar Pal

Reputation: 2986

Django 1.11 - python 3.4 // not able to createsuperuser

**(geoenv) C:\Users\Nitish\Desktop\Mtech Project\Stage 8 database start\geosite>python manage.py createsuperuser You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. Run 'python manage.py migrate' to apply them. Traceback (most recent call last): File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 65, in execute return self.cursor.execute(sql, params) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\sqlite3\base.py", line 328, 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 "manage.py", line 22, in execute_from_command_line(sys.argv) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management__init__.py", line 363, in execute_from_command_line utility.execute() File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management__init__.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 63, in execute return super(Command, self).execute(*args, **options) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management\base.py", line 330, in execute output = self.handle(*args, **options) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 96, in handle default_username = get_default_username() File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\contrib\auth\management__init__.py", line 148, in get_default_username auth_app.User._default_manager.get(username=default_username) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 374, in get num = len(clone) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 232, in len self._fetch_all() File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 1105, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 53, in iter results = compiler.execute_sql(chunked_fetch=self.chunked_fetch) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\sql\compiler.py", line 886, in execute_sql raise original_exception File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\sql\compiler.py", line 876, in execute_sql cursor.execute(sql, params) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 80, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 65, in execute return self.cursor.execute(sql, params) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\utils.py", line 94, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\utils\six.py", line 685, in reraise raise value.with_traceback(tb) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 65, in execute return self.cursor.execute(sql, params) File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\sqlite3\base.py", line 328, in execute return Database.Cursor.execute(self, query, params)

django.db.utils.OperationalError: no such table: auth_user

Upvotes: 0

Views: 343

Answers (1)

Nitish Kumar Pal
Nitish Kumar Pal

Reputation: 2986

createsuperuser cmd can only be used after making models and makemigrations and migrate cmd. I was trying to use it before that.

Upvotes: 1

Related Questions