43,699 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
41
views
Django Summernote: How to delete attachment files from server when removing them from admin?
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 ...
2
votes
2
answers
55
views
Django REST project doesn’t detect apps inside the "apps" directory when running makemigrations
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....
0
votes
0
answers
69
views
'django.db.utils.ProgrammingError: relation "users_user" does not exist' error while running ' python manage.py migrate_schemas --shared'
AccrediDoc - Multi-tenant Accreditation Management System
A comprehensive Django-based multi-tenant accreditation management system designed for healthcare organizations in India. Manage NABL, NABH, ...
1
vote
2
answers
92
views
How to reuse a Django model for multiple relationships
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 ...
1
vote
1
answer
94
views
Custom Permissions in django-ninja which needs to use existing db objects
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 ...
0
votes
1
answer
97
views
How to reset password in a Django UserChangeForm
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.
...
2
votes
3
answers
109
views
Query Django Users by get_username method
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")
...
0
votes
1
answer
52
views
Django model with FK to learner app model Group is displaying options from user admin Group
I have the following models:
learner app
class Group(models.Model):
short_name = models.CharField(max_length=50) # company acronym
slug = models.SlugField(default="...
2
votes
1
answer
56
views
Multiple Data Entry in Django ORM
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 ...
1
vote
1
answer
62
views
CheckConstraint in Django model not triggering in unittest.TestCase (AssertionError: IntegrityError not raised)
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 ...
0
votes
1
answer
55
views
Custom Connection usage in graphene_django
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 '...
0
votes
2
answers
200
views
Managing Django groups and permissions for custom users
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):
...
0
votes
1
answer
86
views
Django REST API endpoints URL paths
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')
...
1
vote
1
answer
44
views
Validating admin form data of a ManyToManyField in Django
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(
'...
2
votes
1
answer
44
views
Django ORM, seeding users and related objects by OneToOneField
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, ...