920951018002774
UnYeong Jeong
  • 2016.4.23 17:20
  • 조회수 153
  • 답변수 5
920951018002774
UnYeong Jeong
  • 2016.4.23 17:20
  • 조회수 153
  • 답변수 5

런서버에서 오류가납니다.

syntaxerror 인데요...

분명히 똑 같이 입력했는데 그렇습니다,

문제가 뭘까요?!

Unhandled exception in thread started by ", line 986, i
File "", line 969, i
File "", line 958, i
File "", line 673, i
File "", li
File "", line 222, i
File "C:\dev\mysite\mysite\urls.py", line 20, in
url(r'', include('elections.urls')), #주소, 누
File "C:\Anaconda3\lib\site-packages\django\conf\
urlconf_module = import_module(urlconf_module)
File "C:\Anaconda3\lib\importlib_init.py", li
return bootstrap.gcd_import(name[level:], pac
File "", line 986, i
File "<frozen importlib.
bootstrap>", line 969, i
File "<frozen importlib.
bootstrap>", line 958, i
File "", line 673, i
File "<frozen importlib.
bootstrap_external>", li
File "", li
File "", li
File "", line 222, i
File "C:\dev\mysite\elections\urls.py", line 7
url(r'polls/(?P\d+)/$', views.polls),

  • #장고를 활용한 웹사이트 만들기
  • #여론조사 결과저장

5 답변

  • Gscxhpxkg5i74t30rimh
    정두식
    • 2016.4.23 21:31

    urls.py의 내용을 올려주세요. 저것만 봐서는 이유를 모르겠네요.

  • 920951018002774
    UnYeong Jeong
    • 2016.4.24 17:45

    from django.conf.urls import url
    from . import views #.은 현재 폴더라는 뜻

    urlpatterns = [
    url(r'$', views.index),
    url(r'areas/(?P.+)/$',views.areas)
    url(r'polls/(?P\d+)/$', views.polls),
    ]

    이 상태입니다 ㅜㅜ 다음 강의로 넘어가고싶은데 가질 못하네요 ㅎㅎ

  • G3rlasealonpd5c2kica
    Demi
    • 2016.4.25 10:55

    마크다운 문법이

    <>
    

    이 부등호 기호와 안의 내용물을 생략해서 에러 이름 부분이 안보입니다. 에러 출력 부분을

    ```

    에러내용~

    ```

    이런식으로 적어주시면 문제를 정확히 파악할 수 있을 것 같습니다

  • 920951018002774
    UnYeong Jeong
    • 2016.4.25 21:28

    '''
    Unhandled exception in thread started by .wrapper at 0x0000015C3E855950>
    Traceback (most recent call last):
    File "C:\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
    File "C:\Anaconda3\lib\site-packages\django\core\management\commands\runserver.py", line 116, in inner_run
    self.check(display_num_errors=True)
    File "C:\Anaconda3\lib\site-packages\django\core\management\base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
    File "C:\Anaconda3\lib\site-packages\django\core\checks\registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
    File "C:\Anaconda3\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
    return check_resolver(resolver)
    File "C:\Anaconda3\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
    for pattern in resolver.url_patterns:
    File "C:\Anaconda3\lib\site-packages\django\utils\functional.py", line 33, in get
    res = instance.dict[self.name] = self.func(instance)
    File "C:\Anaconda3\lib\site-packages\django\core\urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    File "C:\Anaconda3\lib\site-packages\django\utils\functional.py", line 33, in get
    res = instance.dict[self.name] = self.func(instance)
    File "C:\Anaconda3\lib\site-packages\django\core\urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
    File "C:\Anaconda3\lib\importlib_init.py", line 126, in import_module
    return bootstrap.gcd_import(name[level:], package, level)
    File "", line 986, in gcd_import
    File "", line 969, in _find
    and_load
    File "<frozen importlib.
    bootstrap>", line 958, in find_and_load_unlocked
    File "", line 673, in _load
    unlocked
    File "<frozen importlib.
    bootstrap_external>", line 662, in exec_module
    File "", line 222, in call_with_frames_removed
    File "C:\dev\mysite\mysite\urls.py", line 20, in
    url(r'', include('elections.urls')), #주소, 누가 처리 / include는 앱 실행할 때 추가
    File "C:\Anaconda3\lib\site-packages\django\conf\urls_
    init
    .py", line 52, in include
    urlconf_module = import_module(urlconf_module)
    File "C:\Anaconda3\lib\importlib__init
    .py", line 126, in import_module
    return bootstrap.gcd_import(name[level:], package, level)
    File "", line 986, in _gcd_import
    File "<frozen importlib.
    bootstrap>", line 969, in _find_and_load
    File "<frozen importlib.
    bootstrap>", line 958, in find_and_load_unlocked
    File "", line 673, in _load
    unlocked
    File "<frozen importlib._bootstrap
    external>", line 658, in exec_module
    File "", line 764, in get_code
    File "", line 724, in source_to_code
    File "", line 222, in call_with_frames_removed
    File "C:\dev\mysite\elections\urls.py", line 7
    url(r'polls/(?P<poll
    id>\d+)/$', views.polls),
    ^
    SyntaxError: invalid syntax
    '''

    이게 에러입니다!

  • 1088831574511700
    이성용
    • 2016.7.20 23:44

    정규 표현식에서 < url에서 함수로 전달해 주는 변수명 > 으로 < > 사이에 처리되는 함수로 전달해주는 변수 이름이 빠져있네요.

답변 쓰기

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