V
V
Vitaly Ananiev2021-10-02 18:28:42
Django
Vitaly Ananiev, 2021-10-02 18:28:42

Why the error IndentationError: unexpected indent?

Everything worked fine when running the runserver, then I moved the project folder to the desktop and again launched the runserver back in PycharmProjects and there:

Traceback (most recent call last):
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\__init__.py", line 16, in setup
    from django.urls import set_script_prefix
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\__init__.py", line 1, in <module>
    from .base import (
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\base.py", line 9, in <module>
    from .exceptions import NoReverseMatch, Resolver404
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\exceptions.py", line 1, in <module>
    from django.http import Http404
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\http\__init__.py", line 5, in <module>
    from django.http.response import (
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\http\response.py", line 15, in <module>
    from django.core.serializers.json import DjangoJSONEncoder
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\serializers\__init__.py", line 23, in <module>
    from django.core.serializers.base import SerializerDoesNotExist
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\serializers\base.py", line 7, in <module>
    from django.db import models
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\__init__.py", line 31, in <module>
    from django.db.models.base import DEFERRED, Model  # isort:skip
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\base.py", line 1
    return cls._meta.base_manager
IndentationError: unexpected indent

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Vitaliy\PycharmProjects\gameone-1\GamesEx\manage.py", line 22, in <module>
    main()
  File "C:\Users\Vitaliy\PycharmProjects\gameone-1\GamesEx\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 370, in execute
    _parser = self.fetch_command('runserver').create_parser('django', 'runserver')
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 244, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 37, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 10, in <module>
    from django.core.servers.basehttp import (
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\servers\basehttp.py", line 17, in <module>
    from django.core.handlers.wsgi import LimitedStream
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\wsgi.py", line 5, in <module>
    from django.core.handlers import base
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py", line 11, in <module>
    from django.urls import get_resolver, set_urlconf
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\__init__.py", line 1, in <module>
    from .base import (
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\base.py", line 9, in <module>
    from .exceptions import NoReverseMatch, Resolver404
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\exceptions.py", line 1, in <module>
    from django.http import Http404
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\http\__init__.py", line 5, in <module>
    from django.http.response import (
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\http\response.py", line 15, in <module>
    from django.core.serializers.json import DjangoJSONEncoder
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\serializers\__init__.py", line 23, in <module>
    from django.core.serializers.base import SerializerDoesNotExist
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\serializers\base.py", line 7, in <module>
    from django.db import models
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\__init__.py", line 31, in <module>
    from django.db.models.base import DEFERRED, Model  # isort:skip
  File "C:\Users\Vitaliy\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\models\base.py", line 1
    return cls._meta.base_manager
IndentationError: unexpected indent

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-10-02
@Vitalii181190

The indents are incorrectly placed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question