django-context refers to the special django.template.Context class used for passing data from the view to the template
Questions tagged [django-context]
171 questions
0
votes
2 answers
get_profile() fails randomly in Django project
In my Django project I have a user authentication system. Each user has a userprofile:
# Extending main user profile
class UserProfile(models.Model):
# Required
user = models.OneToOneField(User)
# Added fields to main user model
…

Rubén Jiménez
- 1,835
- 5
- 21
- 29
0
votes
1 answer
django-postman discards RequestContext
I installed django-postman to my project. Afterwards, I saw that when I login, it logs in to the user home but then whenever I click on a link, session goes out. It wants me to re-login.
I'm using context_instance=RequestContext(request) at each…

aladagemre
- 592
- 5
- 16
-1
votes
1 answer
Django user.is_superuser not returning true in template if statement
I'm trying to have information about an object show up if the user is a super user. Normally the information is hidden unless the object's public attribute is true. The object.public part works and {{user.is_superuser}} works as expected but {% if…
-1
votes
3 answers
Django loop through json object
How to loop through a JSON object in Django template?
JSON:
"data": {
"node-A": {
"test1A": "val1A",
"test2A": "val2A",
"progress": {
"conf": "conf123A"
"loc": "loc123A"
},
"test3A": "val3A"
},
…

rens
- 89
- 2
- 9
-1
votes
1 answer
Return address in ListView
How to return address in DealershipList with ListView?
I try in views.py
class DealershipList(ListView):
template_name = 'dealership_list.html'
model = Dealership
def get_queryset(self):
pass
def get_context_data(self,…

Regis Santos
- 3,469
- 8
- 43
- 65
-2
votes
1 answer
How to receive context to base template django?
I have base template base.html and page.html and page2.html, who extend base.html
page.html
{% extends 'base.html' %}
page2.html
{% extends 'base.html' %}
I want to receive some context to base.html when i send request to page.html and…

Vadim Beglov
- 47
- 6