Questions tagged [django-1.11]

Django 1.11 is a version of the Django framework, released April 2017. It is a Long Term Support (LTS) release, and will be supported until at least April 2020. Please only use this tag if your question relates specifically to this version.

Django 1.11 requires Python 3.4, 3.5, or 3.6. It is the last version of Django to support Python 2.

Here are some of the salient features of Django 1.11:

Django-1.11 was released in April 2017 as a long-term support release and will be supported until April 2020.

324 questions
3
votes
1 answer

FormView does not execute the form_valid() method

I am using Braintree as a Payment solution (Sandbox). When I use a fill the form it redirect me to the same page. My error is that the Form doesn't get process. On the FormView only the get_context_data() were execute but not…
3
votes
1 answer

dbbackup specify which pg_dump to use

When calling from django.core.management import call_command call_command('dbbackup', compress=True, interactive=False) I get: CommandConnectorError: Error running: pg_dump xxx --host=localhost --port=xxx --username=xxx --no-password --clean…
dendragon
  • 135
  • 10
3
votes
2 answers

What is "output_field" in django

Django doc says for aggregate functions: output_field - An optional argument that represents the model field of the return value So I expected that the code below returns "True". MyModel.objects.annotate(foo=Max(Value("yes"),…
3
votes
1 answer

redirect user after update in class based view in django

I'm using Django 1.11. I'm using Class based view for update profile page, to updated auth user profile info. myapp/accounts/views.py class UpdateProfile(UpdateView): model = User fields = ['first_name', 'last_name'] template_name =…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
3
votes
1 answer

How change html template of ImageField in edit form?

I use Django 1.11 in my project. In my edit form I have ImageField. Django by default render html which you can see below. How change html of ImageField in edit form correctly? I tried next code but Django raise error TemplateDoesNotExist. Django…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
3
votes
2 answers

Django 1.11 admin form add search box to oneToOne field

I have a user, admin and employee models, both employee and admin are related to the user model with a oneToOne field what i would like to do is in the admin form i have one field "user" instead of having a drop down field with all users i would…
leila
  • 461
  • 1
  • 7
  • 21
3
votes
2 answers

Django 1.11: post form data to database

I am making a super-minimalistic blogging application as a first project. I'm having trouble getting my form's CharField to show up on the page, and I'm having trouble finding a concise explanation as to how I'd put that form data into my…
Adam Silver
  • 93
  • 2
  • 10
3
votes
1 answer

Django FilteredSelectMultiple not rendering on page

I am currently using Django version 1.11.2 and would like to use the FilteredSelectMultiple widget outside of the admin page. This is my forms.py: class TBDAuthGroupManageForm(forms.Form): permissions =…
DHerls
  • 827
  • 9
  • 21
3
votes
1 answer

Two ManyToMany relations to the same model via the same intermediate model in Django

My models: class Person(SchoolModel): first_name = models.CharField(max_length=75) last_surname = models.CharField(max_length=75) students = models.ManyToManyField('self', through='StudentParent', through_fields=('parent',…
mehmet
  • 7,720
  • 5
  • 42
  • 48
3
votes
2 answers

Update to 1.11: TypeError build_attrs() takes at most 2 arguments (3 given)

I a updating from 1.10.7 to 1.11.0 and I am getting the following error when viewing a form. I cannot fathom what is wrong with my form at all. Other forms work in the same way. I suspect that it could be an interaction with either select2 or…
2
votes
1 answer

Aborting long running request in Django

I want to abort a request to an API which takes longer than 5 seconds. I know the client-side code can have a timeout of 5 seconds and that will ensure it doesn't wait any longer than that to get a response, but the Django server would still be…
2
votes
1 answer

Using DISTINCT with Multiple Condtional Aggregations (Annotate)

Python: 2.7 Version: Django 1.11 Hello, I am having issues with using conditional aggregation with COUNT DISTINCT in my Django query. The problem is when I join a separate table, my distinct count on the IDs does not seem to work. I have a query…
2
votes
1 answer

Django Admin LogEntry: how it works in non admin actions?

I am having some struggles how does exactly django.admin.LogEntry objects are created. Consider the following scenario: I have a bunch of functions which take a csv file with data that allow me to create multiple objects at one call (just iterate…
hikamare
  • 304
  • 1
  • 14
2
votes
0 answers

How to serialize update on DRF with a modified listField

I have a serializer like this: class Serializer(serializers.ModelSerializer): main_field = ListField(child=serializers.CharField(), required=True) class Meta: model = Model fields = ( "main_field", …
2
votes
0 answers

Include custom URL prefix for languages in Django

I am trying to include the country codes as well while implementing django language translation apart from the usual language codes like en and ar which would be appended to the url's. I am trying to acheive something like this…
Fahim Ahmed
  • 397
  • 4
  • 16