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
0 answers

Error staging application: App staging failed in the buildpack compile phase Failed (python)

I am uploading my django application to cloud foundry, here is my manifest.yml file applications: - name: onlinecourse routes: - route: madhavatreya.au-syd.cf.appdomain.cloud memory: 128M buildpack: python_buildpack - name:…
0
votes
1 answer

How do i display the category name of a product instead of Category object (1) django 3.1

So my django backend is not displaying the category name but is instead giving me a category object result screenshot of undesired result under the category field. How do i fix this?? Below is a snippet of my admin.py and…
Isi
  • 21
  • 3
0
votes
1 answer

Django ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'

I know others have had a similar issues with and getting this same error, but I think my situation is unique. I am running Django 3.1.4 and on my local machine, I can run python manage.py shell with no issue. On the server instance, running what…
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
0
votes
1 answer

Local development Django static files coming from library directory rather than my project

I have a Django (3.1) app that I've set up to serve static files, that is, myapp/settings.py has DEBUG = True . . . INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', …
wogsland
  • 9,106
  • 19
  • 57
  • 93
0
votes
0 answers

django apache2 settings on ubuntu 20 for intranet access

I can't seem to get my django site to be accessible outside of development. I have looked at countless tutorials and they all say the same thing, which I have tried. nevertheless, it doesn't work. here is what I have ubuntu 20.04 installed in a…
anp925
  • 59
  • 4
0
votes
1 answer

Use of Subquery on django's update

I'm currently getting this error Joined field references are not permitted in this query Any idea why it happens if I do this? (models recreated into a simpler version) class Foo(models.Model): bar = models.ForeignKey( Bar,…
Brandon
  • 46
  • 7
0
votes
3 answers

Django project does not work after being transferred from Windows to Mac

I'm using Django 3.1.7 on a MacBook Pro after transferring the Django project off of a Windows 10 machine. However, upon re-setting up the database and superuser and running the command pipenv sync to install all necessary modules, the server does…
Peter Nielsen
  • 251
  • 4
  • 17
0
votes
0 answers

Application labels aren't unique

Has anybody encountered the following error? Building simple django python blog application. traceback Any ideas as to what it correlates to would be appreciated. Have not found a solution as of yet. INSTALLED_APPS
0
votes
1 answer

Django 3.1: Choice of static files directory

I have seen different ways in tutorials where the static files directory keep on changing. 1. Some put static files in the project root directory. Example myproject |__blog | |__migrations | |__static | |__templates mysite | static |__blog …
0
votes
1 answer

Django page not found (404) in my core/urls.py file. Only works when the urls are rearranged

I am relatively new to Django. I've set up my URLs in my core/urls.py file this way and I do get a 404 error when I opened localhost:8000/posts/ on the browser. Code is shown here urlpatterns = [ path('', views.IndexView.as_view(),…
0
votes
2 answers

Django admin list_display is not displaying model method return item

I'm not able to get the list_display of admin to show the information from a model method, but the same method displays fine in the fieldsets on the change page. I think I've fixed all my mistakes that are present in other questions/answers on this…
Raleford
  • 3
  • 2
0
votes
1 answer

Django TabularInline error in the admin.py file

Hey guys i have been trying to create an inline TabularInline view of the my model in the django admin.py file. I am facing an issue where i am getting the following error in the code below. Exception in thread django-main-thread: Traceback (most…
kaybrian
  • 61
  • 1
  • 6
0
votes
0 answers

How to fill / highlight a multipolygon using geojson data in ol 6?

I have a webapp in django 3 & ol6. My views.py is like this def highlightboundary(request): searchArr = [] output = {} dist = District.objects.filter(created_on__year__in=[2020,2021]) for d in dist: …
Adithya
  • 1,687
  • 3
  • 19
  • 34
0
votes
0 answers

Django email won't send inside a view function

def contactform(request): if request.method == 'GET': form = contact_form() else: form = contact_form(request.POST) if form.is_valid(): contact_name = form.cleaned_data['aname'] contact_email =…
NbaRo
  • 83
  • 2
  • 10
0
votes
1 answer

How to add a calculated field to a django query expression

I have a Django model, DocumentComments, with two datetime fields, created and updated. I am working on a search function that parses a search string and returns a Q expression to query the DocumentComments model based on the values in the search…
user1045680
  • 815
  • 2
  • 9
  • 19
1 2 3
8 9