0
我得到錯誤「未找到模板」,雖然我已經設置了正確的模板層次(或因此我認爲)Django的模板在主項目目錄錯誤未找到
.
├── manage.py
├── twinja
│ ├── admin.py
│ ├── admin.pyc
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── migrations
│ │ ├── __init__.py
│ │ └── __init__.pyc
│ ├── models.py
│ ├── models.pyc
│ ├── tests.py
│ └── views.py
└── twinjasite
├── __init__.py
├── __init__.pyc
├── settings.py
├── settings.py~
├── settings.pyc
├── static
│ └── twinja
│ ├── fonts
│ │ └── bootstrap
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ ├── images
│ ├── javascripts
│ │ ├── bootstrap
│ │ │ ├── affix.js
│ │ │ ├── alert.js
│ │ │ ├── button.js
│ │ │ ├── carousel.js
│ │ │ ├── collapse.js
│ │ │ ├── dropdown.js
│ │ │ ├── modal.js
│ │ │ ├── popover.js
│ │ │ ├── scrollspy.js
│ │ │ ├── tab.js
│ │ │ ├── tooltip.js
│ │ │ └── transition.js
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ └── bootstrap-sprockets.js
│ └── stylesheets
│ ├── framework.css
│ └── styles.css
├── templates
│ └── twinja
│ ├── base.html
│ └── menu.html
├── urls.py
├── urls.py~
├── urls.pyc
├── views.py
├── views.py~
├── views.pyc
├── wsgi.py
└── wsgi.pyc
起初我設置up templates/base
但這沒有奏效。所以我做到了,因爲你在這裏看到:templates/twinja/base
理想情況下,我設置了獨立於應用程序的主要模板文件,我認爲它應該放在主文件夾中(其中settings.py是),但也許我錯了。
是的,我在'已安裝的應用程序中設置'twinja'。
這裏出現什麼問題?
TemplateDoesNotExist at/
twinja/base.html
不,我正在使用默認的settings.py,但添加的數據庫除外。 – 1Up