강의로 돌아가기
radiant1010

모듈에러가 나면서 진행이 안됩니다.

Unhandled exception in thread started by .wrapper at 0x0647FF18>
Traceback (most recent call last):
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py, line 225, in wrapper
fn(args, **kwargs)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\runserver.py, line 120, in inner_run
self.check(display_num_errors=True)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py, line 364, in check
include_deployment_checks=include_deployment_checks,
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py, line 351, in _run_checks
return checks.run_checks(
*kwargs)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py, line 73, in run_checks
new_errors = check(app_configs=app_configs)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py, line 13, in check_url_config
return check_resolver(resolver)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py, line 23, in check_resolver
return check_method()
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py, line 397, in check
for pattern in self.url_patterns:
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py, line 36, in get
res = instance.dict[self.name] = self.func(instance)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py, line 536, in url_patterns
patterns = getattr(self.urlconf_module, urlpatterns, self.urlconf_module)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py, line 36, in get
res = instance.dict[self.name] = self.func(instance)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py, line 529, in urlconf_module
return import_module(self.urlconf_name)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py, line 126, in import_module
return bootstrap._gcd_import(name[level:], package, level)
File , line 994, in _gcd_import
File , line 971, in _find_and_load
File , line 955, in _find_and_load_unlocked
File , line 665, in _load_unlocked
File , line 678, in exec_module
File , line 219, in _call_with_frames_removed
File C:\code\mysite\mysite\urls.py, line 5, in
url(r'', include('elections.urls')), #localhost:8000으로 요청이 들어오면 elections.urls로 전달
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\conf.py, line 34, in include
urlconf_module = import_module(urlconf_module)
File "C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\importlib__init
_.py, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File
, line 994, in _gcd_import
File
, line 971, in _find_and_load
File
", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'elections.urls'

여기는 서버를 키고 입력을 하였을때 뜨는 오류입니다.

Performing system checks...

Unhandled exception in thread started by .wrapper at 0x05FBFF18>
Traceback (most recent call last):
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\conf.py, line 17, in include
urlconf_module, app_name = arg
ValueError: too many values to unpack (expected 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py, line 225, in wrapper
fn(args, **kwargs)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\runserver.py, line 120, in inner_run
self.check(display_num_errors=True)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py, line 364, in check
include_deployment_checks=include_deployment_checks,
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py, line 351, in _run_checks
return checks.run_checks(
*kwargs)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\registry.py, line 73, in run_checks
new_errors = check(app_configs=app_configs)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py, line 13, in check_url_config
return check_resolver(resolver)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\checks\urls.py, line 23, in check_resolver
return check_method()
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py, line 397, in check
for pattern in self.url_patterns:
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py, line 36, in get
res = instance.dict[self.name] = self.func(instance)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py, line 536, in url_patterns
patterns = getattr(self.urlconf_module, urlpatterns, self.urlconf_module)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\functional.py, line 36, in get
res = instance.dict[self.name] = self.func(instance)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py, line 529, in urlconf_module
return import_module(self.urlconf_name)
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File , line 994, in _gcd_import
File , line 971, in _find_and_load
File , line 955, in _find_and_load_unlocked
File , line 665, in _load_unlocked
File , line 678, in exec_module
File , line 219, in _call_with_frames_removed
File C:\code\mysite\mysite\urls.py, line 8, in
url(r'admin/', include(admin.site.urls)), #app 접속을 위해 include를 씁니다.
File C:\Users\Radiant\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\conf.py, line 27, in include
'provide the namespace argument to include() instead.' % len(arg)
django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include() is not supported. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead.

이것은 서버를 재기동 하였을때 뜨는 오류입니다.

경로명, 윈도우 이름 모두 영어로 되어있고요
파이썬 버전은 3.6x 사용중입니다.

1 개의 답변
프로그래머스

'provide the namespace argument to include() instead.' % len(arg)
django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include() is not supported. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead.

에러메세지를 보니 urls.py에 오타(comma를 빼먹었던가 하는)가 있는 것 같은데요. 실제 코드를 봐야할 것 같네요.
urls.py의 내용물을 복사해서 답변으로 달아주시면, 어떤 부분이 잘못되었는지 알려드리겠습니다.

답변 쓰기
이 입력폼은 마크다운 문법을 지원합니다. 마크다운 가이드 를 참고하세요.