The project works well with a database on postgres. No problem. I create a new postgres database locally, I specify its parameters in settings.py:

$python manage.py makemigrations 

I get the error:

  django.db.utils.ProgrammingError: relation "report_person" does not exist LINE 1: ...t_person"."name", "report_person"."position" FROM "report_pe... 

I tried to specify SQLite3 in settings.py and deleted (and did not delete) the migrations folder. Always the same mistake. Just tried to create a table in the database through the console with columns as the model fields. So mistake, that "TABLE already EXIST" Tell me, where I do not catch up? And therefore it is impossible to make migrate on HEROKU

 $ heroku run python manage.py migrate 

Same error

  django.db.utils.ProgrammingError: relation "report_person" does not exist LINE 1: ...t_person"."name", "report_person"."position" FROM "report_pe... 

Although before sending to Heroku I do successful makemigrations in the first database (the only one I can) Noob, I sit for so much time. If I start another project, it migrates to a new database ... Thank you

  • Try to do the migration sequentially, starting with those applications that have no dependencies. In your case, starting with the application, where there is a model of Person - Ivan Semochkin
  • @IvanSemochkin yes Ivan, thank you. Approximately solved the problem. It turned out that this form did not allow: - Ruslan Stanevich
  • @IvanSemochkin from django import form q = models.Person.objects.all () qty = range (len (q)) PersonForm = type ('PersonForm', (forms.Form,), {'person' + '_' + str (q [i] .id): forms.BooleanField (label = q [i] .name, required = False) for i in qty}) - Ruslan Stanevich

0