django templates

add to settings.py

STATICFILES_DIRS = ( os.path.join(BASE_DIR,’static’), )
TEMPLATE_DIRS = ( os.path.join(BASE_DIR,’templates’), )

add to views.py

from django.shortcuts import render

# Create your views here.
from django.http import HttpResponse
from todo.models import Task

def index(request): a=Task.objects.all() context={‘task_text’:a} return render(request, ’todo/b.html’ ,context)

note:where todo is application name and task is class and task_text is object

add to url.py

from django.conf.urls import include, url
from django.contrib import admin
from todo import views

urlpatterns = [ url(r’^admin/’, include(admin.site.urls)), url(r’^$’,views.index),
]

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.