Просмотр исходного кода

Adding template dir to TEMPLATES, adding base form templates

David Ray 8 лет назад
Родитель
Сommit
5e9dfac82a
2 измененных файлов с 16 добавлено и 1 удалено
  1. 1 1
      bakerydemo/settings/base.py
  2. 15 0
      bakerydemo/templates/base/form_page.html

+ 1 - 1
bakerydemo/settings/base.py

@@ -82,7 +82,7 @@ ROOT_URLCONF = 'bakerydemo.urls'
 TEMPLATES = [
     {
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
-        'DIRS': [],
+        'DIRS': ['bakerydemo/templates', ],
         'APP_DIRS': True,
         'OPTIONS': {
             'context_processors': [

+ 15 - 0
bakerydemo/templates/base/form_page.html

@@ -0,0 +1,15 @@
+{% load wagtailcore_tags %}
+<html>
+    <head>
+        <title>{{ page.title }}</title>
+    </head>
+    <body>
+        <h1>{{ page.title }}</h1>
+        {{ page.intro|richtext }}
+        <form action="{% pageurl page %}" method="POST">
+            {% csrf_token %}
+            {{ form.as_p }}
+            <input type="submit">
+        </form>
+    </body>
+</html>