Q&A
책을 따라하다가 막히는 부분이 있나요?
질문을 남겨주세요.
이 페이지는 의견 교환을 위해 따로 만든 페이지입니다. 책에서 이 페이지를 만드는 법을 직접적으로 다루지는 않습니다.
하지만, 책을 끝까지 읽고 나면 이 페이지도 만드실 수 있을거에요.
하지만, 책을 끝까지 읽고 나면 이 페이지도 만드실 수 있을거에요.
블로그 작성버튼을 누르면 다음과 같은 오류 발생(해결책을 알려주세요) -crispy 버젼도 바꾸고 여러방법을 동원해도 해결이 안됩니다. ㅠㅠㅠ
11 months, 2 weeks ago
hsollcTemplateDoesNotExist at /blog/create_post/
bootstrap4/uni_form.html
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/blog/create_post/ |
Django Version: | 4.2.7 |
Exception Type: | TemplateDoesNotExist |
Exception Value: | bootstrap4/uni_form.html |
Exception Location: | D:\test\jcgblog\venv\Lib\site-packages\django\template\backends\django.py, line 84, in reraise |
Raised during: | blog.views.PostCreate |
Python Executable: | D:\test\jcgblog\venv\Scripts\python.exe |
Python Version: | 3.11.5 |
Python Path: | ['D:\\test\\jcgblog', 'C:\\Users\\hsoll\\Anaconda3\\python311.zip', 'C:\\Users\\hsoll\\Anaconda3\\DLLs', 'C:\\Users\\hsoll\\Anaconda3\\Lib', 'C:\\Users\\hsoll\\Anaconda3', 'D:\\test\\jcgblog\\venv', 'D:\\test\\jcgblog\\venv\\Lib\\site-packages'] |
Server time: | Sun, 10 Dec 2023 13:21:18 +0900 |
Template-loader postmortem
Django tried loading these templates, in this order:
Using engine django
:
django.template.loaders.app_directories.Loader
: D:\test\jcgblog\venv\Lib\site-packages\django\contrib\admin\templates\bootstrap4\uni_form.html (Source does not exist)django.template.loaders.app_directories.Loader
: D:\test\jcgblog\venv\Lib\site-packages\django\contrib\auth\templates\bootstrap4\uni_form.html (Source does not exist)django.template.loaders.app_directories.Loader
: D:\test\jcgblog\venv\Lib\site-packages\django_extensions\templates\bootstrap4\uni_form.html (Source does not exist)django.template.loaders.app_directories.Loader
: D:\test\jcgblog\venv\Lib\site-packages\markdownx\templates\bootstrap4\uni_form.html (Source does not exist)django.template.loaders.app_directories.Loader
: D:\test\jcgblog\venv\Lib\site-packages\allauth\templates\bootstrap4\uni_form.html (Source does not exist)django.template.loaders.app_directories.Loader
: D:\test\jcgblog\blog\templates\bootstrap4\uni_form.html (Source does not exist)django.template.loaders.app_directories.Loader
: D:\test\jcgblog\single_pages\templates\bootstrap4\uni_form.html (Source does not exist)
Error during template rendering
In template D:\test\jcgblog\blog\templates\blog\post_form.html
, error at line 9
bootstrap4/uni_form.html
1 | {% extends 'blog/base_full_width.html' %} |
---|---|
2 | {% load crispy_forms_tags %} |
3 | {% block head_title %}Create Post - Blog{% endblock %} |
4 | |
5 | {% block main_area %} |
6 | <h1>Create New Post</h1> |
7 | <hr/> |
8 | <form method="post" enctype="multipart/form-data">{% csrf_token %} |
9 | {{ form | crispy }} |
10 | <div id="div_id_tags_str"> |
11 | <label for="id_tags_str">Tags:</label> |
12 | <input type="text" name="tags_str" id="id_tags_str" class="textinput textInput form-control"> |
13 | </div> |
14 | <br/> |
15 | |
16 | <button type="submit" class="btn btn-primary float-right">Submit</button> |
17 | </form> |
18 | {{ form.media }} |
19 | {% endblock %} |
Traceback Switch to copy-and-paste view
D:\test\jcgblog\venv\Lib\site-packages\django\template\backends\django.py
, line 61, in renderreturn self.template.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 175, in renderreturn self._render(context) ^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 167, in _renderreturn self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 1005, in renderreturn SafeString("".join([node.render_annotated(context) for node in self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 1005, in <listcomp>return SafeString("".join([node.render_annotated(context) for node in self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 966, in render_annotatedreturn self.render(context) ^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\loader_tags.py
, line 157, in renderreturn compiled_parent._render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 167, in _renderreturn self.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 1005, in renderreturn SafeString("".join([node.render_annotated(context) for node in self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 1005, in <listcomp>return SafeString("".join([node.render_annotated(context) for node in self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 966, in render_annotatedreturn self.render(context) ^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\loader_tags.py
, line 63, in renderresult = block.nodelist.render(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 1005, in renderreturn SafeString("".join([node.render_annotated(context) for node in self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 1005, in <listcomp>return SafeString("".join([node.render_annotated(context) for node in self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 966, in render_annotatedreturn self.render(context) ^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 1064, in renderoutput = self.filter_expression.resolve(context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\base.py
, line 742, in resolvenew_obj = func(obj, *arg_vals) ^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\crispy_forms\templatetags\crispy_forms_filters.py
, line 58, in as_crispy_formtemplate = uni_form_template(template_pack) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\crispy_forms\templatetags\crispy_forms_filters.py
, line 21, in uni_form_templatereturn get_template("%s/uni_form.html" % template_pack) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\loader.py
, line 19, in get_templateraise TemplateDoesNotExist(template_name, chain=chain) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
The above exception (bootstrap4/uni_form.html) was the direct cause of the following exception:
D:\test\jcgblog\venv\Lib\site-packages\django\core\handlers\exception.py
, line 55, in innerresponse = get_response(request) ^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\core\handlers\base.py
, line 220, in _get_responseresponse = response.render() ^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\response.py
, line 114, in renderself.content = self.rendered_content ^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\response.py
, line 92, in rendered_contentreturn template.render(context, self._request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\backends\django.py
, line 63, in renderreraise(exc, self.backend) ^^^^^^^^^^^^^^^^^^^^^^^^^^
…
Local vars
D:\test\jcgblog\venv\Lib\site-packages\django\template\backends\django.py
, line 84, in reraiseraise new from exc ^^^^^^^^^^^^^^^^^^
목록보기
sungyong 11 months, 1 week ago
settings.py에서 INSTALLED_APPS에 crispy_bootstrap4를 추가했는지 확인해보시겠어요?
Updated: Dec. 13, 2023, 11:49 p.m.
Leave a Comment: