Questions tagged [django-3.2]

Django 3.2 is the current LTS version of the Django framework, released April 2021. It is a Long Term Support (LTS) release, and will be supported until April 2024. Please only use this tag if your question relates specifically to this version.

Django 3.2 works with Python 3.6, 3.7, 3.8, 3.9, and 3.10.

Here are some of the salient features of Django 3.2:

Django 3.2 was released in April 2021 and is supported until April 2024.

128 questions
0
votes
0 answers

Django include template as variable to use in default

I'd like to include a default template as a variable to pass it into a default case, like below:
{% include 'blog/userprofile_deleted.html' as deleted_profile %} {{ user.profile.bio | safe |…
Krabs
  • 3
  • 1
  • 4
0
votes
1 answer

ImportError: cannot import name 'TagHelperNode' from 'django.template.base'

I'm facing the error of cannot import name 'TagHelperNode' from 'django.template.base' while im trying to migrate to django 3.2 I know that the problem will be solved if I downgrad django but I can't do that
0
votes
0 answers

How can I filter ManyToManyField items base on user groups?

staff.models.py from django.db import models from website.models import Website class Staff(models.Model): name = models.CharField(max_length=80) websites = models.ManyToManyField(Website) # CHOICES = ['Chemical','Mechanical','IT'] …
0
votes
0 answers

Why upgrading django version to 3.2 makes the project run "ValueError: Empty module name"?

when I upgrade django version from 3.1 to 3.2 and run my django project, I faced this error: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner …
0
votes
3 answers

How can i define default value for urls parameters in Django?

views.py from django.views.generic import ListView from .models import Staff class StaffListView(ListView): model = Staff template_name = 'staff/staff_list.html' def get_queryset(self): return…
Darwin
  • 1,695
  • 1
  • 19
  • 29
0
votes
0 answers

How can i keep Django summit form and show a message to user?

I want to create a user when an article submit in Django admin form. I want to check a user is existed or not. After it, I want to show a message to user that user is existed, and he can change username to create. Article model…
Darwin
  • 1,695
  • 1
  • 19
  • 29
0
votes
0 answers

In Django Debug request url shown as http instead of https

sorry if the message reads weird: it was originally intended for django support. Let me give a little bit of context to the issue. Recently, my team has upgraded the packages of our app, one of those packages being Django, from 2.2 to 3.2.13. The…
0
votes
1 answer

How can i give 'add_modelname','change_modelname', 'delete_modelname', 'view_modelname' permissions to a group in django?

I have a model named Flower and a group named mygroup. How can i give 'add_flower','change_flower', 'delete_flower', 'view_flower' permissions to mygroup group? new_group, created = Group.objects.get_or_create(name='mygroup') if created: …
Darwin
  • 1,695
  • 1
  • 19
  • 29
0
votes
1 answer

Django - separated settings by environment. Not finding variable from base settings

I've split my django environment as per this post. In settings/base.py I have BASE_DIR specified: BASE_DIR = Path(__file__).resolve().parent.parent.parent In settings/__init__.py I have: from .base import * env = os.environ['ENV'] ... if env ==…
ron_g
  • 1,474
  • 2
  • 21
  • 39
0
votes
1 answer

how to create multisite django with one database?

I want to create some websites on a server with one database. my structure is: main_domain.com/ main_domain.com/website1 main_domain.com/website2 . . main_domain.com/website_n Some contents are common between websites. I use Django 3 What is best…
Darwin
  • 1,695
  • 1
  • 19
  • 29
0
votes
1 answer

How i can create a muti value filed without manytomany field in django?

I have a model: class People(models.Model): family = models.CharField(null=True) phone_numbers = ? How i can implement phone_numbers for some phone numbers. I think ManyToManyField is not a good idea for doing this. What is best practice for…
Darwin
  • 1,695
  • 1
  • 19
  • 29
0
votes
1 answer

Django 3.2.9 Url Path İmportError

I have created a django project called "blogprojesi". I want to import the urls.py file inside the application I created with the name "inf" to the urls.py file inside this project, but I am getting the following error ImportError: cannot import…
ALT
  • 25
  • 4
0
votes
1 answer

In Django, how do I construct a serializer that captures data in a join table?

I'm using Python 3.9 and Django 3.2. I have a couple of models -- a Coop model, which has many Address models, linked through a join table (CoopAddressTags) class Coop(models.Model): objects = CoopManager() name =…
Dave
  • 15,639
  • 133
  • 442
  • 830
0
votes
0 answers

Create a reverse relationship to two models

I have a model User. For performance and other reasons I have to split this Model and its table into two, UserA and UserB. I decided to use materialized views (with the help of django-pgviews). Now what IS easy is to query the data of UserA which is…
Tim
  • 929
  • 1
  • 14
  • 28
0
votes
1 answer

Django 3.2.11 LTS admin change form and change list page shows all the models

I am using django version 3.2.11, and on change form, change list page of every model it shows all the models. I have attached the image. PS: collectstatic command is run too. and no admin template customization is done.
Maverick
  • 2,738
  • 24
  • 91
  • 157
1 2 3
8 9