Хочу, чтоб шаблон подставлялся в базовый шаблон при запросе определённой страницы.
base.html
{% include content %}
template.html (шаблон, который будет подставляться)
BLABLA
views.py
from django.shortcuts import render_to_response
from django.http import HttpResponse,HttpRequest
def first(request):
return render_to_response('first.html')
def registration(request):
content = "'registr.html'"
return render_to_response('first.html', {'content':content})
urls.py
from django.conf.urls.defaults import *
from cars.views import *
import os.path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = patterns('',
(r'^first/$', first),
(r'^registration/$', registration),
)
Даёт такую ошибку: TemplateDoesNotExist at /first/
No exception supplied
Если в шаблоне base.html вместо {% include content %} сделать {% include 'registr.html' %}, тогда всё работает