Top "Django-views" questions

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

How can I find script's directory with Python?

Consider the following Python code: import os print os.getcwd() I use os.getcwd() to get the script file's directory …

python directory django-views getcwd
How do I call a Django function on button click?

I am trying to write a Django application and I am stuck at how I can call a view function …

python django django-templates django-views
Django optional url parameters

I have a Django URL like this: url( r'^project_config/(?P<product>\w+)/(?P<project_id&…

python django django-views django-urls
How can I get the username of the logged-in user in Django?

How can I get information about the logged-in user in a Django application? For example: I need to know the …

python django django-templates django-views models
Django request get parameters

In a Django request I have the following: POST:<QueryDict: {u'section': [u'39'], u'MAINS': [u'137']}> How do …

python django django-models django-views
Why does DEBUG=False setting make my django Static Files Access fail?

Am building an app using Django as my workhorse. All has been well so far - specified db settings, configured …

django django-views django-staticfiles
Class has no objects member

def index(request): latest_question_list = Question.objects.all().order_by('-pub_date')[:5] template = loader.get_template('polls/index.html') …

python django django-views
The view didn't return an HttpResponse object. It returned None instead

I have the following simple view. Why is it resulting in this error? The view auth_lifecycle.views.user_profile …

python django django-views
How do I return JSON without using a template in Django?

This is related to this question: Django return json and html depending on client python I have a command line …

python json django django-views
Django DoesNotExist

I am having issues on trying to figure "DoesNotExist Errors", I have tried to find the right way for manage …

python django django-models django-views