# Simple stupid Error: getting super calm!

**URL:** <https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782>\
**Category:** Mystery Errors\
**Created:** [April 3, 2024, 2:26pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782 "2024-04-03T14:26:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kanatbek-AKA](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kanatbek-aka/32/12281_2.png) [@Kanatbek-AKA](https://forum.djangoproject.com/u/Kanatbek-AKA)\
**Post date:** [April 3, 2024, 2:26pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782/1 "2024-04-03T14:26:33Z")

</div>

Hi all,

After spending a few hours to solve such simple stupid issue am currently encountering with Django, I would like to know whether it is possible that Django framework does stop to see the registered table.  
I am wondering what might cause such issue? Have cleaned cache, restarted pc.

Simple app  
models.py

```auto
from django.db import models
class Book(models.Model):
    ids = models.IntegerField(null=True, blank=True)
    title = models.CharField(max_length=100, blank=True, null=True)
    subtitle = models.CharField(max_length=200, blank=True, null=True)
    authors = models.CharField(max_length=150, blank=True, null=True)
    publisher = models.CharField(max_length=150, blank=True, null=True)
    published_date = models.DateField() # auto_no_addw=False, default=False
    category = models.CharField(max_length=100, blank=True, null=True)
    distribution_expense = models.DecimalField(
        max_digits=6, decimal_places=2, default=0, null=True, blank=True
    )

    def __str__ (self):
        return self.title

```

admin.py

```auto
from django.contrib import admin
admin.site.register(Book)

```

Error

```auto

# OperationalError at /ToDo/admin/myapp/book/

no such table: myapp_book

|Request Method:|GET|
| --- | --- |
|Request URL:|http://localhost:8000/ToDo/admin/myapp/book/|
|Django Version:|4.2|
|Exception Type:|OperationalError|
|Exception Value:|no such table: myapp_book|
|Exception Location:|/home/dostor/.local/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py, line 328, in execute|
|Raised during:|django.contrib.admin.options.changelist_view|
|Python Executable:|/usr/bin/python3|
|Python Version:|3.10.12|
|Python Path:|['/mnt/c/Users/aka_a/Documents/Python ' 'Scripts/nodejs/website_node/Coursera/trackApp', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/home/dostor/.local/lib/python3.10/site-packages', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.10/dist-packages', '/home/dostor/.local/lib/python3.10/site-packages/odf', '/home/dostor/.local/lib/python3.10/site-packages/odf', '/home/dostor/.local/lib/python3.10/site-packages/odf', '/home/dostor/.local/lib/python3.10/site-packages/odf', '/home/dostor/.local/lib/python3.10/site-packages/odf', '/home/dostor/.local/lib/python3.10/site-packages/odf', '/home/dostor/.local/lib/python3.10/site-packages/odf']|
|Server time:|Wed, 03 Apr 2024 14:23:08 +0000|

```

Thanks for your reply in advance.

Kind regards,  
Kanatbek

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 3, 2024, 2:33pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782/2 "2024-04-03T14:33:51Z")

</div>

It’s saying the table doesn’t exist.

Have you run your `makemigrations` and `migrate` for your app?

(It may help if you show the output from a `showmigrations` command.)

---

<div class="post-metadata">

**Author:** ![Kanatbek-AKA](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kanatbek-aka/32/12281_2.png) [@Kanatbek-AKA](https://forum.djangoproject.com/u/Kanatbek-AKA)\
**Post date:** [April 3, 2024, 2:43pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782/3 "2024-04-03T14:43:48Z")

</div>

Hi Ken,

Thanks for your reply. Of course, I run _makemigrations_ and _migrate_ before to run _runserver_. Besides, using _./manage.py shell_ I can import Book model e.g. _from myapp.models import Book_  
The strange things is I tried to check in two laptops OS: Windows10 and ChromeOS. Both laptops throwing the same issues on admin panel when I click on Books table. No clue why?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 3, 2024, 2:46pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782/4 "2024-04-03T14:46:55Z")

</div>

> [@Kanatbek-AKA](#):
>
> I can import Book model e.g. _from myapp.models import Book_

That’s actually not relevant at all. An import imports the class definition, it makes no attempt to access the database.

Please post the output of a showmigrations command as requested above.

---

<div class="post-metadata">

**Author:** ![Kanatbek-AKA](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kanatbek-aka/32/12281_2.png) [@Kanatbek-AKA](https://forum.djangoproject.com/u/Kanatbek-AKA)\
**Post date:** [April 3, 2024, 2:53pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782/5 "2024-04-03T14:53:04Z")

</div>

Here is showmigrations:

…B:/mnt/c/Users/aka\_a/Documents/Python Scripts/nodejs/website\_node/Coursera/trackApp$ python3 manage.py showmigrations  
admin `[X] 0001_initial [X] 0002_logentry_remove_auto_add [X] 0003_logentry_add_action_flag_choices`  
auth  
`[X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length [X] 0010_alter_group_name_max_length [X] 0011_update_proxy_permissions [X] 0012_alter_user_first_name_max_length`  
contenttypes  
`[X] 0001_initial [X] 0002_remove_content_type_name`  
explorer  
`[X] 0001_initial [X] 0002_auto_20150501_1515 [X] 0003_query_snapshot [X] 0004_querylog_duration [X] 0005_auto_20160105_2052 [X] 0006_query_connection [X] 0007_querylog_connection [X] 0008_auto_20190308_1642 [X] 0009_auto_20201009_0547 [X] 0010_sql_required [X] 0011_query_favorites [X] 0012_alter_queryfavorite_query_alter_queryfavorite_user [X] 0013_querylog_error_querylog_success`  
sessions  
`[X] 0001_initial`

for some reason model Book is not migrated in Db. Any clues?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 3, 2024, 2:59pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782/6 "2024-04-03T14:59:02Z")

</div>

Yes. You didn’t create a migration for it.

See the docs for [django-admin and manage.py | Django documentation | Django](https://docs.djangoproject.com/en/5.0/ref/django-admin/#makemigrations)

If your app doesn’t have a proper `migrations` directory, you need to run `makemigrations` with the name of the app as a parameter.

---

<div class="post-metadata">

**Author:** ![Kanatbek-AKA](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kanatbek-aka/32/12281_2.png) [@Kanatbek-AKA](https://forum.djangoproject.com/u/Kanatbek-AKA)\
**Post date:** [April 3, 2024, 3:03pm UTC](https://forum.djangoproject.com/t/simple-stupid-error-getting-super-calm/29782/7 "2024-04-03T15:03:31Z")

</div>

Thanks Ken,

I really was used to run makemigations without even calling parameter. Then in all my previous projects everything was running smoothly until today. Seems, something is happened with my pc settings.

Thanks again for your time.

Kind regards,
