Created
December 12, 2012 21:26
-
-
Save jmg/4271779 to your computer and use it in GitHub Desktop.
Django class based view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.views.generic import TemplateView | |
class MyView(TemplateView): | |
url = "myurl/view1" | |
template_name = "index/template.html" | |
def get(self, *args, **kwargs): | |
context = {} | |
context["projects"] = Project.objects.all() | |
return self.render_to_response(context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment