인프런 커뮤니티 질문&답변

김웅평님의 프로필 이미지
김웅평

작성한 질문수

Django REST Framework 핵심사항

프로잭트를 생성하고 runserver하면 ModuleNotFoundError: No module named 발생해요

해결된 질문

작성

·

723

·

수정됨

0

가상환경을 만들고 새로운 프로잭트를 만들었는데 runserver하면 ModuleNotFoundError: No module named [예전에 만든 프로잭트 폴더이름] 이 뜨면서 에러가 나요..

 

가상환경이 아닌곳에서 해도 똑같이 에러가 발생하고 삭제하고 다시 만들고 settings.py, wsgi 등등 에서도 잘 확인했습니다만 해결이 안됩니다.

해결방법이 있을까요?

 

에러코드

 < File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line

utility.execute()

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 440, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\base.py", line 415, in run_from_argv

connections.close_all()

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\connection.py", line 84, in close_all

for conn in self.all(initialized_only=True):

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\connection.py", line 76, in all

return [

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\connection.py", line 73, in __iter__

return iter(self.settings)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\functional.py", line 57, in __get__

res = instance.__dict__[self.name] = self.func(instance)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\connection.py", line 45, in settings

self._settings = self.configure_settings(self._settings)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\db\utils.py", line 148, in configure_settings

databases = super().configure_settings(databases)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\connection.py", line 50, in configure_settings

settings = getattr(django_settings, self.settings_name)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\conf\__init__.py", line 92, in __getattr__

self._setup(name)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\conf\__init__.py", line 79, in _setup

self._wrapped = Settings(settings_module)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\site-packages\django\conf\__init__.py", line 190, in __init__

mod = importlib.import_module(self.SETTINGS_MODULE)

File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>", line 1050, in _gcd_import

File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked

File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

File "<frozen importlib._bootstrap>", line 1050, in _gcd_import

File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'blog'>

답변 4

1

김석훈님의 프로필 이미지
김석훈
지식공유자

독자님.

이메일이 안 왔습니다. kimseokhun@gmail.com 잘 보냈는지 확인 부탁합니다.

김웅평님의 프로필 이미지
김웅평
질문자

다시 보냈습니다

image

0

김석훈님의 프로필 이미지
김석훈
지식공유자

makemigrations 명령에서 에러가 난거죠 ?

>python manage.py makemigrations movie_api

위 명령 실행하시고, 실행시 폴더, 가상환경 볼 수 있게, 명령과 결과 올려주실래요.

장고버전도 알려주세요. (>django-admin --version 명령으로 알 수 있음)

김웅평님의 프로필 이미지
김웅평
질문자

 

(venv) PS C:\Users\USER21R16\OneDrive\바탕 화면\test\movie> python manage.py makemigrations movie_api
Traceback (most recent call last):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 453, in execute
    self.check()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 485, in check
    all_issues = checks.run_checks(
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\checks\files.py", line 10, in check_setting_file_upload_temp_dir
    setting = getattr(settings, "FILE_UPLOAD_TEMP_DIR", None)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 102, in __getattr__
    self._setup(name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blog'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\movie\manage.py", line 22, in <module>
    main()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\movie\manage.py", line 18, in main   
    execute_from_command_line(sys.argv)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 425, in run_from_argv
    connections.close_all()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 84, in close_all
    for conn in self.all(initialized_only=True):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 76, in all
    return [
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 73, in __iter__
    return iter(self.settings)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 45, in settings
    self._settings = self.configure_settings(self._settings)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\db\utils.py", line 148, in configure_settings
    databases = super().configure_settings(databases)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 50, in configure_settings
    settings = getattr(django_settings, self.settings_name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 102, in __getattr__
    self._setup(name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blog'

 

(venv) PS C:\Users\USER21R16\OneDrive\바탕 화면\test\movie> django-admin --version      
4.2.2

 

image

똑같이 에러가 발생하네요.

 

이 사진은 다른 폴더에 있는 프로잭트인데 여기서는 runserver 실행시 문제가 없습니다....

image

 

0

김석훈님의 프로필 이미지
김석훈
지식공유자

db.sqlite3 파일이 안 보이네요. migrate 명령은 실행했나요 ?

movie\urls.py 도 확인해 보시구요.

에러난 명령과 에러 메시지를 모두 볼 수 있게 올려주세요.

아니면 전체 파일 (venv 폴더 제외)을 kimseokhun@gmail.com 으로 보내 주시면 확인해 보겠습니다.

김웅평님의 프로필 이미지
김웅평
질문자

전체파일 이메일로 보냈습니다. django만 pip install했고 잘 작동하나 확인차 프로잭트랑 앱만 만들고 건들이지 않았습니다.

makemigrations 하면

 

Traceback (most recent call last):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 412, in run_from_argv       
    self.execute(*args, **cmd_options)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 453, in execute
    self.check()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 485, in check
    all_issues = checks.run_checks(
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)  
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\checks\files.py", line 10, in check_setting_file_upload_temp_dir
    setting = getattr(settings, "FILE_UPLOAD_TEMP_DIR", None)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 102, in __getattr__
    self._setup(name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)       
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load  
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load  
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blog'

During handling of the above exception, another exception occurred:   

Traceback (most recent call last):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\movie\manage.py", line 22, in <module>
    main()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\movie\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 425, in run_from_argv       
    connections.close_all()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 84, in close_all
    for conn in self.all(initialized_only=True):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 76, in all
    return [
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 73, in __iter__
    return iter(self.settings)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 45, in settings
    self._settings = self.configure_settings(self._settings)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\db\utils.py", line 148, in configure_settings
    databases = super().configure_settings(databases)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 50, in configure_settings       
    settings = getattr(django_settings, self.settings_name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 102, in __getattr__
    self._setup(name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)       
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load  
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blog'

이런 에러가 발생하구요

movie/urls.py

from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
]

 

runserver하면 발생하는 메시지입니다.

Traceback (most recent call last):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 412, in run_from_argv       
    self.execute(*args, **cmd_options)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\commands\runserver.py", line 74, in execute    super().execute(*args, **options)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\commands\runserver.py", line 81, in handle 
    if not settings.DEBUG and not settings.ALLOWED_HOSTS:
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 102, in __getattr__
    self._setup(name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)       
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load  
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blog'

During handling of the above exception, another exception occurred:   

Traceback (most recent call last):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\movie\manage.py", line 22, in <module>
    main()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\movie\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\core\management\base.py", line 425, in run_from_argv       
    connections.close_all()
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 84, in close_all
    for conn in self.all(initialized_only=True):
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 76, in all
    return [
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 73, in __iter__
    return iter(self.settings)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 45, in settings
    self._settings = self.configure_settings(self._settings)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\db\utils.py", line 148, in configure_settings
    databases = super().configure_settings(databases)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\utils\connection.py", line 50, in configure_settings       
    settings = getattr(django_settings, self.settings_name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 102, in __getattr__
    self._setup(name)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\USER21R16\OneDrive\바탕 화면\test\venv\lib\site-packages\django\conf\__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\USER21R16\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)       
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load  
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import     
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load  
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blog'

 

0

김석훈님의 프로필 이미지
김석훈
지식공유자

안녕하세요. 독자님.

이 에러는 소스 문제가 아니라 개발환경 문제로 보입니다.

가상환경내에서, where python 명령을 실행해 보세요. 원하는 가상환경의 python 이 나오나요?

해결이 안되었다면, 폴더 구조와 settings.py 파일 올려 주세요.

김웅평님의 프로필 이미지
김웅평
질문자

image

 

<

DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'movie_api',
]

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',
]

ROOT_URLCONF = 'movie.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'movie.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}


# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

>

vscode 삭제하고 다시 설치해도 해결되지 않네요...

image

 image

 

김웅평님의 프로필 이미지
김웅평

작성한 질문수

질문하기