28 Aug 2013

Django Import Cheat-sheet

In large full fledged Django web project consist the several applications and each applications having the view which are using various django's methods or classes. I  have noticed that some imports for methods or classes are used in almost every view. 

To keep them in sight i'm listing it out here : 

from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist, ViewDoesNotExist

from django.utils import simplejson
from django.template.defaultfilters import slugify
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
from django.db.models import Q


from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
from django.forms.models import modelformset_factory

No comments:

Post a Comment