1,512 questions
4
votes
0
answers
74
views
Django ManyToMany table missing even though migrations are applied (Docker + Postgres)
Problem
I am working on a Django project using a PostgreSQL container in Docker. I added a ManyToManyField to one of my models. I keep migrations in .gitignore because my local and production ...
0
votes
0
answers
93
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
40
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
79
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
125
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
80
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
147
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
78
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
51
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
60
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
135
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
53
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 ...
1
vote
2
answers
248
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 ...
0
votes
2
answers
101
views
Django manage.py migration related commands not returning anything
I had an issue with migrations in a project I'm working on, a migration was deleted manually and the sync was ruined, I tried a lot of solutions but nothing worked and at the end I decided to backup ...