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
0
votes
1 answer

When i try to run makemigrations command in django it gave me an error

When i try to run makemigrations command in django it gave me an error: TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not list Help me to resolve this issue. This is my static root and media roots all stuffs: #…
Awais Raza
  • 55
  • 1
  • 9
0
votes
1 answer

__init__() missing 2 required positional arguments: 'from_fields' and 'to_fields' when making migration

I'm just starting to learn about python and django altogether. Im having the error when I try run makemigrations command. added_by = models.ForeignObject(User, default=1, verbose_name="ItemCategory", on_delete=models.CASCADE) I have researched…
TheOnlyIdiot
  • 1,182
  • 7
  • 17
  • 37
0
votes
1 answer

python3 manage.py makemigrations No changes detected

(fcdjango_venv) Subinui-MacBook-Pro:Impassion_community subin$ python3 manage.py makemigrations No changes detected I'm learning Basic Django right now, and was following the lecture, but got problem. I followed the lecture, so first I typed the…
Dpseh
  • 1
  • 2
0
votes
1 answer

makemigrations doesn't add any column, except id column

After creating app1 and adding it in INSTALLED_APPS, I wrote my model in models.py including a table with two columns, cod & name, then typed in Terminal: python manage.py makemigrations app1 and python migrate It worked, but the only thing…
hadi ahadi
  • 116
  • 1
  • 1
  • 6
0
votes
3 answers

Django py manage.py makemigrate

What can I make with it? I'm beginner in python and django. I download it and I i wrote py manage.py makemigrate and I've get error. Can u help me?
user10681755
0
votes
1 answer

How to make model migration for different apps in different db in Django

I have used DB routers for apps, but after running migrate command tables are created in default DB, why?? model code: from django.db import models # Create your models here. class Employee(models.Model): Employee_id =…
Hassan Raza
  • 106
  • 12
0
votes
1 answer

can't import models from django custom seed command

I have a django 2.0.6 project running on python 3.6. I'd like to create a manage.py command that seeds the project database with initial data using faker and factory_boy. I have the subcommand working and printing to stdout. When I try to import the…
0
votes
1 answer

django - python makemigrations

Sorry I'm quite new to Django and Python Anyway, I'm running python 2.7 on mac and trying to create my first project here. I get an error when trying the shell command python manage.py makemigrations. I did the upgrade of the pip previously pip2…
0
votes
2 answers

Django running in Docker container: makemigrations and migrate do not see app's model on launch

I have Django running in a Docker container. The CMD of my Docker file simply runs a script, launch.sh, which inter alia has the following commands: python manage.py makemigrations --no-input --verbosity 1 python manage.py migrate --no-input…
0
votes
1 answer

Django Migrations Issue. makemigrations ignoring some fields in model file

THIS IS MY MODEL FILE from django.db import models class Donor(models.Model): Donor_name = models.CharField(max_length=150), Donor_status = models.IntegerField(), Donor_city = models.CharField(max_length=50), Donor_group =…
RAVI RAJPUT
  • 23
  • 1
  • 1
  • 7
0
votes
0 answers

Django makemigrations error?

I'm new started to Django.where is my fault?
0
votes
1 answer

Django makemigrations Issue

I am stumped. I have a custom model field class that looks for two arguments: app_name and file_dir. In my model definition I have this: files = MultiFileUploadAndViewer(app_name = getAppName(), file_dir='RequestedFiles', blank=True) getAppName()…
DrS
  • 342
  • 1
  • 3
  • 15
0
votes
1 answer

Mezzanine/Django 1.10 migrations: Database tables does not much with migrations

I am using Mezzanine (Django 1.10) so I can't see a "db.sqlite3" I searched similar questions as mine and most of the solutions provided were not effective. I created a new model and later decided to add a new field. I did "python manage.py…
RF_956
  • 329
  • 2
  • 7
  • 18
0
votes
2 answers

Name error: Can not import [model name]

I am trying to link the model Post to the model Topic via a foreign key. When I run the makemigrations command, it raises an import error, and says that the name 'Topic' is not defined. What could be the cause of this? It certainly seems to be…
0
votes
1 answer

OperationalError: index teckno_thematique_ad621c37 already exists

I tried to migrate but I got an error. I did : python ./manage.py makemigrations teckno and python ./manage.py migrate --fake-initial django.db.utils.OperationalError: index teckno_thematique_ad621c37 already exists
Jean-François
  • 61
  • 1
  • 1
  • 5