Questions tagged [django-3.1]

Django 3.1 is a version of the Django framework, released in August 2020. Please only use this tag if your question relates specifically to this version.

Django 3.1 works with Python 3.6, 3.7, 3.8, and 3.9.

Here are some of the salient features of Django 3.1:

Django 3.1 was released in August 2020 and was supported until August 2022.

126 questions
0
votes
1 answer

Issue while rendering view with Django 3.1.3 using render function that works fine with Django 2.2

#Code of Django View: check Output here!! def studiolist_page(request,*args,**kwargs): studiomaster={'studio_master_key':StudioMaster.objects.all()} studiolist_all=StudioDetails.objects.filter(studio_status=10) …
0
votes
1 answer

How do I get total hours from start- end activity ? - Django model

I have the following entries from the model with two variable days. class Log_hour(models.Model): activity_no = models.CharField(max_length=200, null=True) activityDate = models.DateField(auto_now_add=False, null=True) start_activity =…
Samuel Kamau
  • 149
  • 2
  • 4
0
votes
1 answer

How can we implement PayPal PayFlow Pro in Python (Django Application)?

I want to integrate PayPal PayFlow Pro in Python Django web application. Now, I used django-paypal extension but it is not available PayPal PayFlow Pro feature in this. Please let me better solution for this. Django v3.1.0
0
votes
1 answer

is there a way to put delete button on the left side

Is there a way to put the delete button on the left side? i try to use ordering but it doesnt work because delete is not part of the model here is my admin.py class CategoryInline(admin.TabularInline): model = Category extra = 0 class…
Duck Yeah
  • 69
  • 1
  • 6
0
votes
0 answers

MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'SOMEOBJECT_id' in 'field list'")

Before this python manage.py makemigrations - done, also python manage.py migrate - done I do not know what is happening, in the tutorial, that I follow, there is no such error- the syntax is the same in models.py: from django.db import…
0
votes
1 answer

How to customize SearchHeadline in django full text search?

I want to highlight search terms with SearchHeadline. My code is somethink like this: query = SearchQuery('cat') vector = SearchVector('caption') Post.objects.annotate( search=vector headline=SearchHeadline( 'caption', query …
0
votes
1 answer

After an upgrade from Django 1.11 to Django 3.1 django admin shows list of models on top of internal items

After an upgrade from Django 1.11 (python2.7) to Django 3.1 (python3.6) on Centos7, django admin still shows the list of models on top of the page, above the list of items in this model. Before the upgrade, the admin showed everything correctly: you…
sunsetjunks
  • 740
  • 1
  • 9
  • 14
0
votes
2 answers

Django signup: set username to provided email address and save?

Short question (no actual need to read the rest): I have read multiple threads/tutorials (e.g. this one) on how to let users login via email. And I was wondering: why can't I just keep things simple and ask for an email address upon signup and then…
R-obert
  • 553
  • 4
  • 13
0
votes
0 answers

Django 3.1|Python 3.6.12: Custom Template Tags not showing up all the sudden?

I was following one tutorial about Django, and I got stuck, so I've searched for another and another and I come to the situation where I've reinstalled my Linux system x6 (due to Python changes in ~/.bashrc and similar things) I am new here and I am…
0
votes
1 answer

Set cookies for ajax request, when "JsonResponse" is returned

When I use normal (not ajax) request, I do: from django.shortcuts import redirect from django.http import JsonResponse response = redirect('/some_page') response.set_cookie(key='key1', value='value1', max_age=3600) response.set_cookie(key='key2',…
Oto Shavadze
  • 40,603
  • 55
  • 152
  • 236
0
votes
1 answer

How to solve an "OfflineGenerationError: You have offline compression enabled but key ..." served up by Windows 2019 IIS?

My code with django-compressor works on my local machine with DEBUG=True or False, but when I push to production, which is a Windows Server 2019 served by IIS, then it only works with DEBUG=True. If I set to False, then I get this error:…
Douglas T
  • 181
  • 2
  • 7
0
votes
1 answer

Signal in Model of Django

I ask you this question that I cannot find a solution. I am entering records in the Django Admin, so I enter the functions in the model. In my Sample class I add several fields, but the one I have problems with is the "number" field (sample number).…
0
votes
0 answers

how to add custom user model to users section of admin panel - django 3.1.1

I have added a custom user model in my django project which was explained here. I defined extra fields in models.py like this: from django.db import models from django.contrib.auth.models import User from django.db.models.signals import…
Shahriar.M
  • 818
  • 1
  • 11
  • 24
0
votes
1 answer

Deal with django ImageField current value displayed in forms

I'm trying to remove the clear checkbox in Django's ImageField and remove the displayed current value of the file. Tha approach I tried is to replace the widget as proposed here How to not render django image field currently and clear stuff? but the…
Zarrie
  • 325
  • 2
  • 16
0
votes
1 answer

NoReverseMatch(msg) django.urls.exceptions.NoReverseMatch: Reverse for 'home' not found. 'home' is not a valid view function or pattern name

I'm new to using Django and I'm trying to write test for my pages app but I keep on getting the same error when testing for the homepage url name urls.py from django.urls import path from pages.views import HomePageView app_name =…
1 2 3
8 9