1,513 questions
0
votes
0
answers
78
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, ...
0
votes
0
answers
39
views
Django-tenants: relation "journal_nav_topnavitem" does not exist even after adding app to SHARED_APPS and running migrate_schemas --shared
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 ...
0
votes
1
answer
78
views
How to run Django migrations in Visual Studio 2022
I have created a Django project in my Visual Studio solution. The db.sqlite3 file was also created. There are a few classes in models.py.
class Question(models.Model):
q_id = models.IntegerField() ...
0
votes
0
answers
122
views
ModuleNotFoundError: No module named 'backend' when running my make seed data script in django-admin
I am trying to debug and figure out what the issue is. When trying to search, I just get annoying AI responses which I don't want.
Here is my traceback:
Traceback (most recent call last):
File &...
0
votes
1
answer
77
views
How to resolve circular dependency error in django models
I have 2 apps in my django project
customer app
trades app
Customer app has following tables in models.py
customer_table
trade_plan_table
service_plan_table
customer_payments
trades app has ...
0
votes
2
answers
133
views
Django: No tables found in the database after running migrations
I'm working on a Django project, but I'm facing an issue where no tables are being created in my database even after running migrations.
Django version:5.1.3
Database:MySQL
OS:ubuntu 24.04.1 LTS
1 ...
0
votes
0
answers
74
views
Django migrations failing in Docker container after adding new model
I am running a Django project inside a Docker container, and I am facing an issue with migrations after adding a new model to models.py.
When I try to apply the migrations, the system looks for the ...
1
vote
1
answer
50
views
How to create GeneratedField with lookup from settings file?
While using Django 5.1, I'm trying to create a GeneratedField which should return True or False depending on which file has been uploaded. The model will accept both image- and video files. I want to ...
0
votes
1
answer
59
views
why django makemigration command creates python based code instead of creating sql commands [closed]
why django makemigration command creates python based code instead of creating sql commands, Someone please explain from design decision point of view, and what benefits we get from it.
0
votes
1
answer
130
views
How to solve 'django.db.migrations.exceptions.InconsistentMigrationHistory' error?? (using powershell/VSCode)
I am making a web app (I am a student and this is my first attempt of building a project) using stack: Django, Vue and MySQL. Attaching link to git repo here: https://github.com/yeshapan/...
1
vote
1
answer
52
views
Changes detected after squashmigrations
python manage.py showmigrations shows:
mainapp
[X] 0001_initial
...
[X] 0240_employer_data
[X] 0241_person_metadata
[X] 0242_personemployer_employerworkplace
[X] ...
0
votes
1
answer
81
views
Segmentation Fault (Core Dumped) When Running makemigrations with PostgreSQL in Django
I’m trying to connect my PostgreSQL-17 database to a Django project running in a Conda environment on Ubuntu-24. However, when I run python manage.py makemigrations, I keep encountering the following ...
0
votes
0
answers
198
views
How to revert migrations when there are multiple leaf nodes? [duplicate]
manage.py showmigrations shows me a list like
...
[X] 0240_employer_data (A)
[X] 0241_person_metadata (B)
[ ] 0242_delete_capability_delete_collection (C)
[X] 0242_personemployer_employerworkplace ...
0
votes
0
answers
60
views
Django model FileField with dynamic storage location in migration
I need to store file outside MEDIA_ROOT so I use this approach
from django.core.files.storage import FileSystemStorage
from django.db import models
from myproject.settings import SOME_DIR
fs = ...
1
vote
2
answers
238
views
Django migrations: SeparateDatabaseAndState vs --fake
Let's say I have a model:
class MyModel(models.Model):
...
field_no_need_anymore = Charfield(...)
I want to remove field_no_need_anymore, but I don't want to apply changes to the database ...