python - Django use html template from application directory -


i use django 1.10.3 want use html template app dir create app test_page folder templates , testpage.html

in view.py

from django.shortcuts import render  def page(request):      return render(request, 'test_page/testpage.html', locals()) 

in settings.py

templates = [ {     'backend': 'django.template.backends.django.djangotemplates',     'dirs': [os.path.join(base_dir, 'templates')]     ,     'app_dirs': true,     'options': {         'context_processors': [             'django.template.context_processors.debug',             'django.template.context_processors.request',             'django.contrib.auth.context_processors.auth',             'django.contrib.messages.context_processors.messages',         ],     }, }, ] 

but doesn't work. how can use html template dir application?

directory structure:

project/     test_page/         templates/             test_page/                 test_page.html 

Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -