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

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -