How to access a python list or a dict variable in view after rendering it to template?

2018-06-22 Thread Utpal Brahma
views.py @login_required def user_profile(request): grp = get_user_group(request.user) # print(dlist) if grp == 'Student': return render(request, 'sorp_app/s_profile.html') else: iform = forms.StudentInfoForm() mform = forms.StudentMedicalForm()

whats the use of setting mysite.settings to DJANGO_SETTINGS_MODULE?

2018-05-16 Thread Utpal Brahma
under manage.py #!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import

Suggest any document to learn below syntax?

2018-04-10 Thread Utpal Brahma
{{ question.question_text }}{% for choice in question.choice_set.all %} {{ choice.choice_text }}{% endfor %} I got this syntax in Writing your first Django app, part 3. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: No module named django help please

2018-03-27 Thread Utpal Brahma
try : pip install django (if pip is installed) try : pip3 install django (if pip3 is installed) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Contributing to django.

2018-03-27 Thread Utpal Brahma
I have got this error in section //Writing your first patch for Django// when i performed this below command in terminal. i have got an error. git clone g...@github.com:YourGitHubName/django.git error part : Cloning into 'django'... Warning: Permanently added the RSA host key for IP address

Re: How to understand below html code?

2018-03-27 Thread Utpal Brahma
red consciousness that our institutions have >> failed and our ecosystem is collapsing, yet we are still here — and we are >> creative agents who can shape our destinies. Apocalyptic civics is the >> conviction that the only way out is through, and the only way through is >

How to understand below html code?

2018-03-26 Thread Utpal Brahma
I am in tutorial 3 of Django.But i am stuck in understanding the below code.Please heLP me!!! {% if latest_question_list %} {% for question in latest_question_list %} {{ question.question_text }} {% endfor %} {% else %} No polls are available. {% endif %} -- You

Re: Can anyone explain the overidding of save() of below code?

2018-03-21 Thread Utpal Brahma
Thanks Vinicius Assef -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Can anyone explain the overidding of save() of below code?

2018-03-21 Thread Utpal Brahma
/* also explain super ().save() */ from django.db import models class Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextField() def save(self, *args, **kwargs): do_something() super(Blog, self).save(*args, **kwargs) # Call the "real"