Commits

Cliff Dyer committed a02e7dc

Microdjango

  • Participants

Comments (0)

Files changed (3)

+DEBUG = True
+ROOT_URLCONF = 'views'
+
+TEMPLATE_DIRS = ['.']

File template.html

+This is my id: {{ id }}
+from django.conf.urls.defaults import patterns, url
+from django.http import HttpResponse
+from django.shortcuts import render
+
+urlpatterns = []
+
+def index(request):
+    return HttpResponse('Index')
+
+urlpatterns += patterns('', url(r'^$', index))
+
+
+def test(request, id):
+    return render(request, 'template.html', {'id': id})
+
+urlpatterns += patterns('', url(r'^test/(\d+)/$', test))