1Up
1Up

Reputation: 1044

Django template not found in main project directory error

I am getting a 'template not found' error, although I've set up a correct template hierarchy (or so I thought)

.
├── 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

At first I set up templates/base but that did not work. So I made it as you see here: templates/twinja/base

Ideally I'm setting up the MAIN template files which are independent of apps, which I thought was meant to go in the main folder (where settings.py is) but perhaps I am mistake.

Yes, I have 'twinja' set up in installed apps as well.

What appears to be wrong here?

TemplateDoesNotExist at /
twinja/base.html 

Upvotes: 0

Views: 291

Answers (1)

Deja Vu
Deja Vu

Reputation: 731

If your template is independent of apps, it shouldn't be in your app folder - namespace it accordingly.

How do you load your template? Did you setup your templates/staticfolders in your settings.py?

Updated.

For the fresh project you need to configure your settings.py file. Read here, ask away if you still have a question.

Updated.

After you get familiar with static files and how to manage those, spend some time here.

Upvotes: 1

Related Questions