problem bd python manage.py makemigrations & migrate

43 views
Skip to first unread message

Alexandru - Gabriel Ionicescu

unread,
Jun 11, 2023, 3:01:16 PM6/11/23
to Django users
hello, 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 I do?
I mention that in settings.py I have:
  DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
     }
}
MEDIA_ROOT = os.path.join(BASE_DIR, 'images')
MEDIA_URL = '/images/'

Bhuvnesh Sharma

unread,
Jun 11, 2023, 3:12:22 PM6/11/23
to django...@googlegroups.com
Hi,
  This seems a bit unexpected behaviour,could you tell us all the steps you followed from the beginning and at what step is it giving error?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3e36f332-c199-41b7-baf3-43da1c3d437en%40googlegroups.com.

Bradie Poa

unread,
Jun 11, 2023, 3:51:24 PM6/11/23
to Django users
Delete the delete the database, makemigrations and then migrate. 

Bradie Poa

unread,
Jun 11, 2023, 3:54:24 PM6/11/23
to Django users
This is mostly cause be mismatch of migrations. In the migrations folder. If deleting the db fails to work for you. You need to delete or migrations folders and then re-do the process of makemigrations and migrate. This will play you the magic 

On Sun, Jun 11, 2023, 22:12 Bhuvnesh Sharma <bhuvn...@gmail.com> wrote:

Alexandru - Gabriel Ionicescu

unread,
Jun 20, 2023, 1:52:20 PM6/20/23
to django...@googlegroups.com
Hello Bradie,

Is not work.
I delete all db and migrate but is not working..

Issa N'golo Coulibaly

unread,
Jun 20, 2023, 2:23:36 PM6/20/23
to django...@googlegroups.com
First created an application and then
in the settings.py set the constant AUTH_USER_MODEL = "my_app_name.User" and do makemigrations then migrate for the very first time. your custom User table does not exist in the database that's why the exception is thrown.

--

Dilmurod Dilmurod

unread,
Jun 27, 2023, 8:04:41 AM6/27/23
to django...@googlegroups.com

Dush, 12-iyn, 2023, 00:01 Alexandru - Gabriel Ionicescu <ionicescu.ale...@gmail.com>:
--

Dilmurod Dilmurod

unread,
Jun 27, 2023, 8:04:51 AM6/27/23
to django...@googlegroups.com

Dilmurod Dilmurod

unread,
Jun 27, 2023, 8:05:18 AM6/27/23
to django...@googlegroups.com

Dilmurod Dilmurod

unread,
Jun 27, 2023, 8:05:31 AM6/27/23
to django...@googlegroups.com

Dilmurod Dilmurod

unread,
Jun 27, 2023, 8:05:37 AM6/27/23
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages