1,513 questions
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, ...
0
votes
1
answer
72
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
1
answer
70
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
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 ...
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.
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
0
answers
190
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 ...
1
vote
2
answers
233
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
1
answer
74
views
Django makemigrations doesn't create migrations for my app [duplicate]
Here’s a brief overview of what I’ve accomplished so far, to ensure we're all on the same page. Please note that I’m still new to Django, so my approach might not be perfect or even close to what it ...
0
votes
2
answers
109
views
Dokku Procfile "release: python manage.py migrate" results in a NodeNotFoundError "Migration XYZ dependencies reference nonexistent parent node"
When attempting to deploy to the Dokku testing environment with a Postgres database, I encounter an error while the Procfile is being utilized.
-----> Releasing aha-website-test...
-----> ...
0
votes
0
answers
60
views
How to handle Parallel GitHub Actions and Migrations in Django + React Projects
I'm working on a Django + React project, and we use GitHub Actions for CI/CD. The typical workflow when a pull request is raised involves running Selenium tests, which require a large dataset in the ...
0
votes
0
answers
49
views
Django migrations operations inside RunPython code
I'm working with data migrations in django, and at some point, I'll have to run migrations.RunPython. The point is that I wish I could execute migrations operations(AddField, AlterField) under certain ...
0
votes
1
answer
41
views
Unable to update latest database configuration in settings.py in django
I write code on my local machine and then use github to transfer the code to my Amazon AWS EC2 server, I am using AWS Route53 to connect to a domain name and AWS RDS for database (started using ...
0
votes
0
answers
54
views
removing data migrations in Django
I have been working on a Django app for a client. throughout development there have been data migrations (data insertions/modifications, not structural changes) that have been specific to the client. ...
0
votes
0
answers
83
views
How to Create a New Database and Run Migrations Dynamically in Django?
I have an application where I need to create a new database and run migrations to create tables. Here is my current implementation:
def create_database(db_name):
with connection.cursor() as cursor:...
-1
votes
1
answer
96
views
TypeError: 'staticmethod' object is not callable during Django migrations
When I run python manage.py migrate, I encounter the following error:
File "/home/seyedbet/virtualenv/WanderSight/3.9/lib/python3.9/site-packages/django/utils/functional.py", line 57, in ...
0
votes
0
answers
30
views
Django Best practices: migration & contenarization [duplicate]
I am working on a Django API and I'd like to add a bit of CI/CD to it.
It dockerize my app with
FROM python:3.12
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements....
0
votes
1
answer
89
views
psycopg2.errors.UndefinedTable: relation "mydjangoapp_mymodel" does not exist
I am managing a django app built by third parts.
I have configured in settings.py the connection to a new db
'default': { # changed
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': ...
0
votes
1
answer
72
views
character varying error for django and postgresql
i used from postgresql for my django rest project.
but when i want to migrate my project i got some error for character varying like below
(myenv) root@srv524469:~/django-paynans# python manage.py ...
0
votes
0
answers
187
views
Create SQL function using Django migrations command
I am using Django Framework in Python with MySQL Database
For adding a table in the database, I create a class in models.py and then run
python manage.py makemigrations. This creates the migration ...
-1
votes
1
answer
52
views
Django Installable App. Abstract class with dependencies on it's implementation
In my installable Django application, I have a class called Timer which I intend for users to implement:
class Timer(models.Model):
class Meta:
abstract = True
project = models.ForeignKey(...
1
vote
1
answer
101
views
migrate error : ...No migrations to apply
I made some changes in the models from my apps and then entered makemigrations and migrate in the terminal.
PS C:\Users\USER 1\frist project\website> python manage.py makemigrations home
No changes ...
1
vote
2
answers
35
views
Django AUTH_USER_MODEL refers to model 'powerlistapp.appuser' that has not been installed ERROR
i have model as in below
from django.db import models
from django.contrib.auth.models import AbstractUser
class AppUser(AbstractUser):
user_department = models.CharField(max_length=100)
...
0
votes
0
answers
44
views
MySQLdb.OperationalError: and django.db.utils.OperationalError 1054, "Unknown column" after field rename in Django and MySql
I have django app that is connected to MySql database.
I have renamed the field in models.py and succesfuly ran the migration. (the name alteration is written in migrations file)
I have also manually ...
0
votes
1
answer
85
views
Django (removal of .auth and .django tables that are created after migrate command)
I have these 10 tables in Django (6-Auth tables and 4 Django tables) I am not using these files in my production project, I thought of removing them but read that its not a good practice to remove. I ...