Commits

yang xiaoyong  committed 8c01482 Draft

use generic to render model content

  • Participants
  • Parent commits 77eb9fe

Comments (0)

Files changed (2)

File itj/itj/urls.py

 
 from django.conf.urls import patterns, include, url
 from django.contrib import admin
+from django.views.generic import TemplateView
 
 admin.autodiscover()
 
 urlpatterns = patterns('',
+    url(r'^robots.txt$', TemplateView.as_view(template_name="robots.txt")),
+
     url(r'^admin/', include(admin.site.urls)),
+    url(r'^press/', include('press.urls')),
 )

File itj/press/views.py

-# Create your views here.
+# -*- encoding:utf-8 -*-
+# from django.http import HttpResponseNotFound, \
+#         HttpResponseServerError
+from django.shortcuts import get_list_or_404
+
+
+
+def detail(request, pid):
+    return HttpResponseServerError('An error has occured')