from django.shortcuts import (render, redirect, )
from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import (TemplateView, View, )
from django.core.exceptions import (ObjectDoesNotExist, MultipleObjectsReturned)
class MyView(TemplateView):
@method_decorator(login_required)
def get(
class MyTestCase(TestCase):
def assertDictHasKey(self, dictionary, key):
if not key in dictionary:
raise AssertionError('Dictionary is missing key "%s"' % key)
Last active
August 29, 2015 13:56
-
-
Save pfigue/9068831 to your computer and use it in GitHub Desktop.
Django Cheatsheet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment