Internal Server Error 500 오류

Use a production WSGI server instead.

  • Debug mode: off
  • Running on all addresses.
    WARNING: This is a development server. Do not use it in a production deployment.
  • Running on http://192.168.0.3:8000/ (Press CTRL+C to quit)
    [2022-03-19 21:47:12,299] ERROR in app: Exception on / [GET]
    Traceback (most recent call last):
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
    File "c:\appPython\app.py", line 44, in index
    return render_template('index.html')
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\templating.py", line 148, in render_template
    ctx.app.jinja_env.get_or_select_template(template_name_or_list),
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\environment.py", line 1068, in get_or_select_template
    return self.get_template(template_name_or_list, parent, globals)
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\environment.py", line 997, in get_template
    return self._load_template(name, globals)
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\environment.py", line 958, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\loaders.py", line 125, in load
    source, filename, uptodate = self.get_source(environment, name)
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\templating.py", line 59, in get_source
    return self._get_source_fast(environment, template)
    File "c:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\templating.py", line 95, in _get_source_fast
    raise TemplateNotFound(template)
    jinja2.exceptions.TemplateNotFound: index.html
    192.168.0.3 - - [19/Mar/2022 21:47:12] "GET / HTTP/1.1" 500 -

위와 같이 오류가 나옵니다.

오류가 나오는 이유는 render_template함수를 통해서 index.html을 불러오는데 templates 폴더 안에 index.html이 없어서 나오는 것임을 인지했는데
index.html 내용을 어디서 복사해 오는 것인지 모르겠습니다... 도와주세요!!!!

#web
작성자 정보
답변 1
avatar
Naman
강의 수강: 10

app.py만으로는 풀 수 없는거죠? 그냥 접속정보 확인해서 하는거죠?

2022.03.19. 22:06
질문에 대한 답을 알고 계신가요?
지식을 나누고 포인트를 획득해보세요.
답변하고 포인트 받기