Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
53 views

When I delete a file from the Attachment model (which is provided by django-summernote), the record is removed from the database, but the actual file remains on the server. I want to make sure that ...
Afshar Sharifi's user avatar
2 votes
2 answers
67 views

I have a Django REST project where I created a directory called apps to store all my apps. Each app is added to the INSTALLED_APPS list in my settings file like this: INSTALLED_APPS = [ 'django....
Ali Motamed's user avatar
0 votes
0 answers
73 views

AccrediDoc - Multi-tenant Accreditation Management System A comprehensive Django-based multi-tenant accreditation management system designed for healthcare organizations in India. Manage NABL, NABH, ...
Dr BRIJESH PATEL's user avatar
1 vote
2 answers
93 views

I want to make a task model and a user model. And I want each task to be able to be related to 3 users. Each task should be related to a creator user, an assignee user, and a verifier user. And I want ...
wetjosh's user avatar
  • 6,410
1 vote
1 answer
99 views

I am using django-ninja and django-ninja-extra for an api. Currently I have some Schema like so from ninja import schema class SchemaA(Schema) fruit_id: int other_data: str and a controller ...
sea's user avatar
  • 77
0 votes
1 answer
99 views

I have a basic CustomUser model in my project. When I want to update it I fill my form with instance where I try to make user's password null, but anyway in the form I receive: "No password set. ...
user737082's user avatar
2 votes
3 answers
112 views

I am trying to get the Django User object with a specific username. The obvious way to do it is like this: from django.contrib.auth.models import User bob = User.objects.get(username="Bob") ...
PT-Hrothgar's user avatar
0 votes
1 answer
52 views

I have the following models: learner app class Group(models.Model): short_name = models.CharField(max_length=50) # company acronym slug = models.SlugField(default="...
Lisa Higgins's user avatar
2 votes
1 answer
56 views

I have been trying to create a way that my Django database will store data for 7 consecutive days because I want to use it to plot a weekly graph but the problem now is that Django doesn't have a ...
Victor Eninla's user avatar
1 vote
1 answer
62 views

I have a Model class with a series of constraints that I am attempting to test, and I am unable to get these constraints to return an IntegrityError in testing. The class is as follows: from django.db ...
dabo_tusev's user avatar
0 votes
1 answer
56 views

I have a variation of the problem described here: Using DjangoFilterConnectionField with custom Connection in graphene_django The modified problem is as follows: Lets say I have a Django model class '...
BoomDizzle's user avatar
0 votes
2 answers
221 views

For my Django projects, I am used to creating a custom user model and managing what my user can do for a specific route using a roles field like this: class User(AbstractBaseUser, PermissionsMixin): ...
Fazle Rabbi Faiyaz's user avatar
0 votes
1 answer
86 views

I have a Django 4.2 app with Postgres DB and REST API. My urls.py contains this path in urlpatterns: path('create/<int:pk>/<str:name>/', ComponentCreate.as_view(), name='create-component') ...
Paul Sandie's user avatar
1 vote
1 answer
47 views

In Django, I have a ManyToManyField relation to another Table. It is shown as expected as a multi-select list in the admin UI. class Host(models.Model): groups = models.ManyToManyField( '...
Daniel Alder's user avatar
  • 5,524
2 votes
1 answer
44 views

I am designing a django application for educational purposes. I've come up with creating a fake banking application. The idea is to have a User<->BankAccount link by a OneToOneField. Similarly, ...
Sir Donnie's user avatar
0 votes
1 answer
77 views

On my Django Project I have a model that a property is used to store videos in a specific and single Google Cloud Storage bucket, using FileField. The model is defined like this: from storages....
Raul Chiarella's user avatar
0 votes
0 answers
61 views

I'm using django-import-export and trying to work it with multi-thread concurrency. I tried logging the sql queries and notice that INSERT query has id values generated as well. *EDIT: First there's a ...
Azima's user avatar
  • 4,161
0 votes
0 answers
39 views

I'm working on a multi-tenant Django project using django-tenants with Django 3.2.16. I created an app called journal_nav and initially added it only to TENANT_APPS. Later, I moved it to SHARED_APPS ...
Chandragupta Borkotoky's user avatar
1 vote
1 answer
50 views

First of all - I understand that CharField is rather bad primary key, but it's unique in-game name, good 2 use as-is in many places, and may contain spacees. And IMHO the problem will repeat with non ...
dAlexis's user avatar
  • 33
1 vote
1 answer
46 views

I'm refactoring a legacy Django Job to use annotate with filtered Count aggregations instead of querying each record individually (avoiding the N+1 problem). I want to count the number of related ...
Raul Chiarella's user avatar
1 vote
1 answer
71 views

I'm using Django with django-storages and GoogleCloudStorage backend. My model has a FileField like this: raw_file_gcp = models.FileField(storage=GoogleCloudStorage(bucket_name='videos-raw')) At ...
Raul Chiarella's user avatar
2 votes
1 answer
48 views

I have wrote this validators.py file: from django.core.exceptions import ValidationError import os def allow_only_images_validator(value): ext = os.path.splitext(value.name)[1] print(ext) ...
ADAN SHAHID's user avatar
1 vote
1 answer
47 views

I am trying to place two independent forms on one template. I have them placed but there is a problem that both forms are being checked. Validation of both forms is being checked. Although I only have ...
Денис's user avatar
1 vote
1 answer
22 views

Good day! I have two tables - models. I fill them gradually. First I have the first table. First I enter data into the first table. And there - in the first table I have - repeating data. Field - (...
Pinifarina's user avatar
0 votes
2 answers
79 views

I'm working on a Django project where we use models.TextChoices for fields like current_status. Our client requested wording updates — for example, renaming "Contacted" to "Contacted ...
raza hussain's user avatar
0 votes
0 answers
31 views

Good day! I plan to build a mini application. Which consists of one page (the main one) - a template. And also one secondary page - on the second page I fill in information into the model table ...
Pinifarina's user avatar
1 vote
1 answer
44 views

How to pass pk to the form (ForeignKey) and views - from the template when clicking on a link? Good day! I have a model. Which is displayed in the template. And the transition to another template is ...
Pinifarina's user avatar
0 votes
1 answer
55 views

Is it possible to somehow adapt something similar to my problem? I would like a list to appear in the form based on data from another list Select from the second field - filtering data - (contents) ...
Den Silinskii's user avatar
3 votes
1 answer
78 views

I'm building a secure OTP system in Django. The model looks like this: class OTP(models.Model): MAX_ATTEMPTS = 3 DEFAULT_EXPIRE_IN_MINUTES = 1 class Purposes(models.IntegerChoices): ...
Ertugrul's user avatar
  • 175
0 votes
1 answer
65 views

I have 2 model tables. In the first table I have a form in the set in which there is one interesting field. This field can have the same values. If we consider the second table model - then in the ...
Денис's user avatar
2 votes
1 answer
67 views

I have a form with OneToOneField where data is loaded from another table model. But I often have large data sizes there and the displayed text does not fit into the window size. Is it possible to ...
Ridsen's user avatar
  • 41
0 votes
1 answer
42 views

I'm encountering a ValueError in my Django application when trying to save a User object with a related UserRoleAssociation in the admin interface. The error occurs in a multi-database setup where ...
mirodil's user avatar
  • 439
2 votes
1 answer
95 views

If I have, for example: from django.contrib.postgres.fields import JSONField class MyModel(models.Model): data = JSONField() GIVEN a model instance obj1, where data == ['apple', 'banana', '...
Dane Iracleous's user avatar
1 vote
1 answer
39 views

I have two table models. I write data to one of them using a form. I also want to write data to the other model table using a form. But I'm trying to link these tables. Use the first one as a base. ...
Ridsen's user avatar
  • 41
0 votes
1 answer
66 views

I'm trying to prevent users from creating more than one Mining object within a 24-hour period in my Django project. I chose to use Django signals, specifically the pre_save signal, to enforce this ...
Memon's user avatar
  • 63
1 vote
1 answer
46 views

I am new to Django and currently learning and I have encountered a problem that I just can't seem to solve. from django.shortcuts import render, redirect from django.contrib import messages from ....
sssvvv's user avatar
  • 21
0 votes
1 answer
97 views

I am creating an information system in which some entities have separate attributes or a set of them, for which it is necessary to store a history of changes with reference to the date of their ...
Mike Winny's user avatar
-3 votes
1 answer
101 views

Good day! I have a plan for the database structure. An example is in the figure below. For example, I have - all coffee shops - within one region - state or several regions. I am trying to make a ...
Ridsen's user avatar
  • 41
1 vote
1 answer
112 views

I try to variabilise schema name because i use different environnment for my project. So i do this in my models.py: # from django.contrib.auth.models import AbstractUser from django.contrib.auth....
Jules SMITHSON's user avatar
0 votes
1 answer
63 views

I have such a very difficult problem. Which is very specific and not easy to enter data. I am thinking how to send data to the database or, as an option, just send data to the code in the internal ...
Ridsen's user avatar
  • 41
0 votes
1 answer
49 views

I have three 3 Django model tables. They are kind of connected to each other so that each row, each line from one model table corresponds to the same from another model table. You could say that I'm ...
Ridsen's user avatar
  • 41
1 vote
1 answer
48 views

I am getting this error with DRF, django.core.exceptions.ImproperlyConfigured: The included URLconf and I can not find the cause of it. My urls.py is afaiK configured correctly, so I'm looking for ...
user3125823's user avatar
  • 1,958
0 votes
0 answers
42 views

I'm using the django-admin-async-upload library to handle asynchronous file uploads in my Django project. Everything works perfectly in my local development environment. However, when I deploy to the ...
Abhishek Mehta's user avatar
0 votes
0 answers
36 views

Current models: class Task(PolymorphicModel): pass class DownloadTask(Task): pass New models: And now i want to do add a new layer called VirtualTask: class Task(PolymorphicModel): pass ...
Jorge's user avatar
  • 125
0 votes
0 answers
69 views

I'm trying to figure out how to create a vehicle filter for an auto parts application for a client. They want their customers to be able to filter by Year, Make, Model, Trim and Engine. We're using ...
user3125823's user avatar
  • 1,958
2 votes
2 answers
148 views

Django models support default ordering, via Meta.ordering. What are the downsides to putting ordering = ["pk"] on my base model? In particular, I'm curious about the performance impact. ...
Zags's user avatar
  • 41.9k
1 vote
1 answer
49 views

I'm using DRF's ModelViewSet for my views and DefaultRouter to create the urls. This particular model creates a feature that only admins have full CRUD access. Authenticated users should have READONLY ...
user3125823's user avatar
  • 1,958
0 votes
0 answers
44 views

I'm not sure if the title of this post made you understand the problem but let me explain: I have models: class ItemCategory(models.Model): name = CharField() class Item(models.Model): brand =...
Antony_K's user avatar
  • 196
1 vote
1 answer
56 views

I'm trying to be able to search chat groups by looking up the chatroom name. I'm using Django Q query... models.py class ChatGroup(models.Model): group_name = models.CharField(max_length=128, ...
Chris Harden's user avatar
0 votes
1 answer
66 views

poetry run python manage.py test minigames.test.models response in terminal: The currently activated Python version 3.12.9 is not supported by the project (^3.13). Trying to find and use a compatible ...
khanzala's user avatar

1
2 3 4 5
874