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

Two django projects with common userbase , authentication and sharing of key functionalities

I'm building a Django v3.2 project that requires merging of 2 projects(social app and ecommerce) - both of which are separate open source django projects. The end goal is to share users, posts and a common user registration and authentication…
Earthling
  • 83
  • 3
  • 13
1
vote
0 answers

docker-compose:The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user

I'm running 5 docker containers on Ubuntu 22.04. I have created a user and added to the group and logged in by sudo su 'user' I have installed virtualenv and running inside of it. All my commands are without sudo. When i run docker-compose.yml , i…
1
vote
1 answer

How can i implement multi websites in one core in django?

How can I implement multi websites with one core in Django? I have multi websites with this structure: example.com (Main website) example.com/subdirectory1 (Second website) example.com/subdirectory2 (Third website) example.com/subdirectory2/en …
Darwin
  • 1,695
  • 1
  • 19
  • 29
1
vote
0 answers

How to represent custom JSONField out as comma-seperated string in Django Admin list page?

Consider I have a Django model with a custom JSONField as below, # models.py class JSONCustomField(models.JSONField): ... class JSONFieldModel(models.Model): json_field = JSONCustomField(default=list) This model is connected via Django…
JPG
  • 82,442
  • 19
  • 127
  • 206
1
vote
1 answer

Django 3.2.3 Pagination isn't working properly

I have a Class Based View who isn't working properly (duplicating objects and deleting some) Tested it in shell from django.core.paginator import Paginator from report.models import Grade, Exam f = Exam.objects.all().filter(id=7)[0].full_mark all =…
Ahmed Abo 6
  • 1,151
  • 2
  • 9
  • 11
1
vote
2 answers

Why does a Django foreign key id __in query fail to match None?

When filtering a queryset on a nullable foreign key, I can filter by an ID value (foo_id=123) or by None (foo_id=None). However, if I attempt to filter by a list (foo_id__in=[123, None]) the None is ignored. Why is this happening, and what is the…
Wesley
  • 75
  • 6
1
vote
1 answer

Django template nested include passing variables

I use django template index.html to render the frontpage. It includes another template to create a link icon. This template url_icon.html includes another template icon.html. When passing the arguments down the way, I face with an error. How to fix…
ar2015
  • 5,558
  • 8
  • 53
  • 110
1
vote
1 answer

Django 3.2 makemigrations ProgrammingError: table doesn't exist for abstract model

I'm currently updating my website to use Django 3.2, but I use the zinnia blog which is no longer receiving updates. I'm making the necessary changes to bring it up to compatibility with 3.2 but I'm now getting the error that the AbstractEntry table…
somesmart
  • 11
  • 2
1
vote
0 answers

Hide one of the User.ModelAdmin.fieldsets if User role changes in django

Hi I want to hide some fieldsets in admin if user role changes. In get_queryset() I'm changing queryset if role == 'CMS' I also want to hide Permission fieldset for same role. Here is my admin: Note: I'm Using list for fieldsets here I pasted…
Rajat Jog
  • 197
  • 1
  • 10
1
vote
1 answer

TypeError: '_SentinelObject' object is not callable

I am upgrading my Django application from version 2.2 to 3.2. while upgrading i am facing below issue, i have spent a lot of time to resolve this but didn't get any solution yet. here's the traceback of issue which i am facing: File…
Nikunj
  • 33
  • 9
1
vote
1 answer

Django CBV - How to test get_context_data with uuid in url?

I use the UUID in the url instead of the primary key. I assume, but am not sure, that this is the cause of my problem in testing my CBVs. my view for user profile : class ProfileView(DetailView): slug_url_kwarg = 'uuid' slug_field = 'uuid' …
1
vote
1 answer

Static File On Django 3.2 Not Loading

My Problem is quite simple and yet I'm finding it so hard to solve it. The problem is I am not able to load the CSS File and image which are on the static folder located on the root folder of the project. The static folder is not under the app…
yugahang
  • 27
  • 4
1
vote
1 answer

Django context processor not rendering from shell

Using Django 3.2 Have defined few global variables like app/context_processors.py from app.settings import constants def global_settings(request): return { 'APP_NAME': constants.APP_NAME, 'APP_VERSION': constants.APP_VERSION, …
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
1 answer

Customer Manager with related objects in Django 3

In this question it talks about how to set a customer manager when dealing with related objects however the answers release to Django 1 and 2. In version 3 of the doco it says the the Base managers aren't used when querying on related models. Using…
Rudiger
  • 6,749
  • 13
  • 51
  • 102
1
vote
2 answers

AutoField is not reducing the length of column

I am trying to create auto increment field for tiny integer like int(3). If I try AutoField, it generates length of 11. If I use max_length, migration ignores it. SmallIntegerField gives int(6) without auto increment. My model definition: class…
Abcdef
  • 43
  • 7
1 2
3
8 9