Questions tagged [makemigrations]

This is the first step in the two step process to sync changes made to the Django model (in python code) with the database.

https://docs.djangoproject.com/en/1.11/ref/django-admin/#django-admin-makemigrations

113 questions
1
vote
1 answer

"PyCharm can't check if the following file been updated" when doing makemigrations/migrate

When I use PyCharm's manage.py terminal to do a makemigrations or migrate I have the following warning message: PyCharm can't check if the following file been updated: [filepath] for a hundred of files located inside my webpack and…
Ryan Pergent
  • 4,432
  • 3
  • 36
  • 78
1
vote
2 answers

mysql malformed packet error after running makemigrations django

The issue that we are getting is : we have run manage.py makemigrations and manage.py migrate successfully, after which we start getting the below error: File "/usr/local/goibibo/python/lib/python3.5/site-packages/django/db/backends/mysql/base.py",…
abhinsit
  • 3,214
  • 4
  • 21
  • 26
1
vote
2 answers

Django/ Python- should I run makemigrations on a local branch, or only on master?

I am working on a project that has been written in Python/ Django, and have recently made some changes to one of the models. I want to test the changes that I have made now, before I go any further into the development of this new feature, but I am…
Noble-Surfer
  • 3,052
  • 11
  • 73
  • 118
1
vote
1 answer

Django makemigrations does not create models by order in models.py

I have a question about the order in which tables are created in a migration. As there is a ForeignKey in model B to connect to model A, I create models with order of A, B and C in models.py. Then: python manage.py makemigrations app There is the…
zhihong
  • 1,808
  • 2
  • 24
  • 34
1
vote
1 answer

Error models.py Django

I have an error when creating migrations in django models.py class StateBuyers(models.Model): name = models.CharField(max_length=100) def __unicode__(self): return self.name class Meta: db_table = "states" class…
1
vote
1 answer

planet+django makemigration does not work

I am trying to use django-planet on python 3, django 1.9. After following the instruction on their page I get the following error after python manage.py makemigrations: planet.Feed.site: (fields.E300) Field defines a relation with model 'Site',…
A.E
  • 997
  • 1
  • 16
  • 33
1
vote
1 answer

Django - Migrate command says that table exists after second makemigrations was executed

I have one model with the relevant fields setup. I ran manage.py migrate then it created the a table in my database. I then ran manage.py makemigrations so that it could create an initial migration file with prefix '0001'. I added another field to…
Vinu
  • 109
  • 1
  • 14
0
votes
0 answers

python manage.py makemigrations

I have a project and I use django.I'm trying to do my migrations for bd but I can't do them. it gives me the error django.db.utils.OperationalError: no such table: user_user.I also made a User class (AbstractUser) and it still doesn't work. What can…
0
votes
2 answers

Django can't migrate when i make models

whenever i try to add a simple model like this: from django.db import models from django.utils import timezone from django.contrib.auth.models import User # Create your models here. class Post(models.model): author = models.ForeignKey(User,…
0
votes
0 answers

I want to make password field in my model by the inheriting AbstractBaseUser, but it shows me the error about non-nullable iid field

It is impossible to add a non-nullable field 'id' to client without specifying a default. This is because the database needs something to populate existing rows. Please select a fix: Provide a one-off default now (will be set on all existing rows…
0
votes
0 answers

Getting permission denied when use makemigration in django

I am using a docker file to handle my django app. I added user to the docker file as following: FROM python:3.9-alpine3.13 LABEL maintainer="H.Bazai" ENV PYTHONUNBUFFERED 1 COPY requirements.txt /tmp/ COPY requirements.dev.txt /tmp/ COPY app…
0
votes
0 answers

Update front-end when delete a row in database in React native

I am new with Django and I trying to run my first project. But i keep getting this error when trying to run python .\manage.py makemigrations enter image description here I am not sure what is the problem
Bang Do
  • 3
  • 2
0
votes
0 answers

Python/Django MakeMigrations Error Traceback

Here is what appears when i try to use python manage.py makemigrations traceback error Here is models.py code ----------------------code------------------------------------- from django.db import models from django.contrib.auth.models import…
0
votes
0 answers

django project not executing makemigrations command as expected in vscode editör

I have a django project. I moved my project from pyCharm editor to vscode editor. When I run the python manage.py makemigrations command, it creates a migration file for some applications under venv. I think it depends on the LANGUAGE_CODE value in…
erhan
  • 69
  • 2
  • 8
0
votes
1 answer

Python makemigrations does not work right

I use Django framework This is my models.py from django.db import models # Create your models here. class Destination(models.Model): name: models.CharField(max_length=100) img: models.ImageField(upload_to='pics') desc:…