makemigrations

Python makemigrations does not work right

Python makemigrations does not work right Question: 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: models.TextField price: models.IntegerField offer: models.BooleanField(default=False) and here is my migrations folder-0001_initial.py: # Generated by Django 4.1.3 on 2022-11-17 10:17 from django.db import migrations, models …

Total answers: 1

Makemigrations/migrate in django

Makemigrations/migrate in django Question: Could anyone help me solve this problem? I want to add data and time models in Django, but after makemigration, I got this. **You are trying to add a non-nullable field ‘MeterReading_DateTime’ to mdm_api without a default; we can’t do that (the database needs something to populate existing rows). Please select …

Total answers: 2

return database_name == ':memory:' or 'mode=memory' in database_name TypeError: argument of type 'WindowsPath' is not iterable

return database_name == ':memory:' or 'mode=memory' in database_name TypeError: argument of type 'WindowsPath' is not iterable Question: I am practicing Django but when I command python manage.py makemigration and python manage.py migrate then I got an error as show in the title. the full error is mentioned below: C:UsersMananpython projectsdjangoandmongonew_Socrai>python manage.py migrate Operations to perform: …

Total answers: 4

how to migrate django models to new database

how to migrate django models to new database Question: i develope a django project on my local system, and now i deployed that to a server. i used MySql as database. whenever i try to migrate my models (using python manage.py migrate or python manage.py makemigrations) to server’s new database, it shows me following error: …

Total answers: 2

Django migrations error KeyError: ('list', u'user')

Django migrations error KeyError: ('list', u'user') Question: I am trying to run python manage.py migrate or python manage.py makemigrations I got this error: Running migrations: No migrations to apply. Traceback (most recent call last): File “manage.py”, line 10, in <module> execute_from_command_line(sys.argv) File “/Users/rostunov/temp/venv/lib/python2.7/site-packages/django/core/management/__init__.py”, line 353, in execute_from_command_line utility.execute() File “/Users/rostunov/temp/venv/lib/python2.7/site-packages/django/core/management/__init__.py”, line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) …

Total answers: 11

Django – no such table exception

"no such table" exception Question: In Django I added models into models.py. After manage.py makemigrations, manage.py migrate raised this exception: django.db.utils.OperationalError: no such table: auth_test_usertranslatorprofile I removed all old migrations and run makemigrations and migrate again which seemed to work. It didn’t help because when I click User customer profiles of User translator profiles it …

Total answers: 28