Skip to content

Instantly share code, notes, and snippets.

@1st
Created June 3, 2013 14:38
Show Gist options
  • Save 1st/5698633 to your computer and use it in GitHub Desktop.
Save 1st/5698633 to your computer and use it in GitHub Desktop.
My example of code for Django project
'''
My example of code for Django project
See also my Open Source project here: https://github.com/1st/django-startup
@author Anton Danilchenko <anton.danilchenko@me.com>
'''
# app_name/urls.py
# app_name/views.py
from tools.views import View
class Blog(View):
request_filters = {'login_required': True}
def get(self, blog_id):
blog = self.get_object_or_404(Blog, id=blog_id)
return self.render('app_name/blog.html', {'blog': blog})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment