강의로 돌아가기
-

NameError

오류가 이렇게 뜨네요 분명히 elections라 했는데...
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\autoreload.py, line
226, in wrapper
fn(*args, **kwargs)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\commands\r
unserver.py
, line 116, in inner_run
self.check(display_num_errors=True)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\base.py,
line 426, in check
include_deployment_checks=include_deployment_checks,
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\registry.py,
line 75, in run_checks
new_errors = check(app_configs=app_configs)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\urls.py, line
13, in check_url_config
return check_resolver(resolver)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\urls.py, line
23, in check_resolver
for pattern in resolver.url_patterns:
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\functional.py, line
33, in get
res = instance.dict[self.name] = self.func(instance)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\urlresolvers.py, lin
e 417, in url_patterns
patterns = getattr(self.urlconf_module, urlpatterns, self.urlconf_module)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\functional.py, line
33, in get
res = instance.dict[self.name] = self.func(instance)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\urlresolvers.py, lin
e 410, in urlconf_module
return import_module(self.urlconf_name)
File C:\Users\joshu_000\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py, line 126, in import_mod
ule
return _bootstrap._gcd_import(name[level:], package, level)
File , line 986, in _gcd_import
File , line 969, in _find_and_load
File , line 958, in _find_and_load_unlocked
File , line 673, in _load_unlocked
File , line 662, in exec_module
File , line 222, in _call_with_frames_removed
File C:\Users\joshu_000\mysite\mysite\urls.py, line 5, in
url(r'',include(elections.urls)),
NameError: name 'elections' is not defined

1 개의 답변
정찬형

C:\Users\joshu_000\mysite\mysite\urls.py

코드에 오타가 있는거 같네요.
mysite 폴더 내부의 urls.py 에서

 url(r'^', include(elections.urls)),

라고 적으신거 아닌가요?

url(r'^', include('elections.urls')),

따옴표가 빠졌는지 확인해주세요.

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