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

Django 1.10 - makemigrations command not detecting changes for unmanaged models

Thanks in advance for your help. Inside mi project I have an app involving models that were generated from an existing database. As those tables are administered by a DBA, they are kept as unmanaged models. As it is possible that we require to…
gaboroncancio
  • 870
  • 1
  • 7
  • 19
3
votes
2 answers

Django app not found despite adding to INSTALLED_APPS?

its just a sample app, app name:wiki #models.py from django.db import models class Page(models.Model): name = models.CharField(max_length=20, primary_key=True) content = models.TextField(blank=True) #settings.py INSTALLED_APPS =…
Swarup Rajbhandari
  • 466
  • 1
  • 6
  • 14
3
votes
2 answers

Django-polymorphic models having issues making migrations on 1.7

I am using Django 1.7 and django-polymorphic for my models class ReferenceItem(PolymorphicModel): created_at = models.DateTimeField(_('date created'), auto_now_add=True, db_index=True) updated_at = models.DateTimeField(_('date modified'),…
James Lin
  • 25,028
  • 36
  • 133
  • 233
2
votes
0 answers

Django migration error : return self.cursor.execute(sql, params) django.db.utils.ProgrammingError:

I tried to delete the migrations folder and db.sqlite3 as suggestions but it didn't work. I've also tried to downgrade version of django. Please look at the error below, I think it's the problem with database : The above exception was the…
Knight
  • 55
  • 2
  • 7
2
votes
1 answer

Can you stop Django automatically reverting a manual Migration?

I have a Model file which has a change which isn't being picked up by DJango makemigrations. I created a manual migration following this answer, but if we run makemigrations afterwards Django creates a new auto migration reverting our manual…
Jethro
  • 3,029
  • 3
  • 27
  • 56
2
votes
1 answer

I got this Error AttributeError: module 'django.contrib.gis.db.models' has no attribute 'GeoManager'

This Is My Models : class Intervention(models.Model): Titre_intervention = models.TextField(max_length=255) date_intervention = models.DateField(auto_now_add=True) type_panne =…
daniel meyer
  • 67
  • 1
  • 8
2
votes
2 answers

django makemigrations override to create migration files with custom names

I have a python2.7 django project (I know, I am in 20th century!) that has some models in it. I need to override makemigrations so that the migration filenames are of the form 0001.py, 0002.py and so on, and not like 0001_initial.py, 0002_model1.py…
TNT
  • 480
  • 1
  • 4
  • 11
2
votes
3 answers

Django 2.2 - django.db.utils.OperationalError: no such table

I am pulling my hair out. I just can't get migrations to work anymore. Every time I run python3 manage.py makemigrations or python3 manage.py makemigrations app_name I get the following error: Traceback (most recent call last): File…
Peter
  • 91
  • 1
  • 11
2
votes
0 answers

Django cannot serialize into migration file

Hi there i'm having problems when trying to use the command makemigrations with manage.py. The output is the following: Migrations for 'reg': reg\migrations\0012_auto_20190917_1711.py - Remove field Products from tenant - Add field…
2
votes
1 answer

How to deal with a `relation "cms_disclaimerpanel" already exists` and ProgrammingError: column "http_request_lang" of relation "xyz" does not exist

I have a rather annoying issue when trying to send my merge to my automated tests on circle CI. Just for the context, I've inherited a project where the authors are no longer working at my current work. I'm working on django and I've done a merge,…
Andy K
  • 4,944
  • 10
  • 53
  • 82
2
votes
2 answers

why do i get syntax error on manage.py makemigrations?

I'm making a test project with python and django (for learning purpose). At some point I have to make a django app called products, then in the models.py file in the "products" app directory I have this code: class Products (models.Model) title…
2
votes
2 answers

error while using makemigration in django

I am working on a development server running python3.5 and Django 1.11 with virtualenv when I use "python manage.py makemigrations" I get this error Traceback (most recent call last): File "manage.py", line 8, in from…
Kamran Hosseini
  • 478
  • 5
  • 25
2
votes
1 answer

Django makemigrations fail in heroku

I'm trying to deploy a Django (1.10.6) app to Heroku, runtime Python 3.6.1. The app runs succesfully (except the fact that tables are not created), but when trying run the makemigrations I get the following error: Running python manage.py…
Prochu1991
  • 443
  • 5
  • 20
2
votes
1 answer

makemigrations permisseion denied

i guess i'm stuck at a big problem. i had to delete the migrations directory in my django app and i thought when i run python manage.py makemigrations the directory will be created back, however i got an error…
ChemseddineZ
  • 1,728
  • 3
  • 14
  • 27
2
votes
1 answer

'makemigrations' asks for a default with none-abstract model inheritance

I'm trying a simple model inheritance: class Product(models.Model): creation_date = models.DateTimeField(auto_now_add=True) class Application(Product): name = models.CharField(max_length=200) 'makemigrations' asks for a default: You are…
billy
  • 35
  • 1
  • 5