python - Django generic views - sending data to project templates -


i try send data generic views app

urlpatterns = patterns('',     (r'*', listview.as_view(         queryset=post.objects.all().order_by("-created")[:2],     template_name="/mysite/templates/index.html"     )), ) 

however, data cannot sent c/p query , result returned. what's missing?

in mysite/templates/index.html

 {% post in object_list %}      {{ post.title }}     {% endfor %} 

prints nothing

you not providing enough information. r'*' not valid regular expression - * needs act on - , django report if tried use in urlconf. need show how including url in main urls.py.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -