Top "Django-views" questions

Django views are MVC views; they control rendering (typically through templates), and the data displayed.

Example of Django Class-Based DeleteView

Does anyone know of or can anyone please produce a simple example of Django's class-based generic DeleteView? I want to …

django django-views django-class-based-views
'RelatedManager' object is not iterable Django

Hey i have looked around through some simliar posts here on SO but havent found anything that has solved my …

django django-models django-views django-queryset
Use get_queryset() method or set queryset variable?

These two pieces of code are identical at the first blush: class IndexView(generic.ListView): template_name = 'polls/index.html' …

django django-views django-generic-views
How do I send empty response in Django without templates

I have written a view which responds to ajax requests from browser. It's written like so - @login_required def …

python ajax django django-views
Disable a method in a ViewSet, django-rest-framework

ViewSets have automatic methods to list, retrieve, create, update, delete, ... I would like to disable some of those, and the …

python django django-views django-rest-framework
How to set up custom middleware in Django

I am trying to create middleware to optionally pass a kwarg to every view that meets a condition. The problem …

python django django-views django-middleware
Django internationalization language codes

Where can I find list of languages and language_code like this. (Swedish,sv) (English,en)

python django internationalization django-views django-i18n
Best way to write an image to a Django HttpResponse()

I need to serve images securely to validated users only (i.e. they can't be served as static files). I …

image django-views
Django 2.0 path error ?: (2_0.W001) has a route that contains '(?P<', begins with a '^', or ends with a '$'

I'm new to Django and am trying to create the back end code for a music application on my website. …

python django python-3.x django-views django-urls
Django - two views, one page

Say we have a Django page that shows a list of items and allows the user to fill in a …

django django-views