-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck at django.db.utils.OperationalError: no such table: guests_guest #55
Comments
Hi thanks for the reply.
I’m simply using the standard setup, so the sqlite database.
I’ve debugged it , and it’s happening in ‘guests/view.py’ where it tries to count the guests in the table: invited_guest_count = Guest.objects.filter(party_name__is_invited=True).count()
But I don’t understand why it tries to run that, it should only run the migrations first, which somehow it doesn’t do.
See the full trace below:
django-wedding-website via 🐍 v3.11.4 (venv) on master ./manage.py migrate
Invalid line: WEDDING_CC_LIST =[]
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Traceback (most recent call last):
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
return Database.Cursor.execute(self, query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such table: guests_guest
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/ncj/Python Projects/django-wedding-website/./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 89, in wrapped
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 75, in handle
self.check(databases=[database])
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 416, in check
for pattern in self.url_patterns:
^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 602, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ***@***.***/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/ncj/Python Projects/django-wedding-website/bigday/urls.py", line 7, in <module>
url(r'^', include('guests.urls')),
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ***@***.***/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/ncj/Python Projects/django-wedding-website/guests/urls.py", line 3, in <module>
from guests import views
File "/Users/ncj/Python Projects/django-wedding-website/guests/views.py", line 43, in <module>
invited_guest_count = Guest.objects.filter(party_name__is_invited=True).count()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/query.py", line 412, in count
return self.query.get_count(using=self.db)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 528, in get_count
number = obj.get_aggregation(using, ['__count'])['__count']
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 513, in get_aggregation
result = compiler.execute_sql(SINGLE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 79, in _execute
with self.db.wrap_database_errors:
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
return Database.Cursor.execute(self, query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.OperationalError: no such table: guests_guest
… On 22 Aug 2023, at 08:53, Cory Zue ***@***.***> wrote:
Strange, I'm not seeing that error on a new project. What DB are you using? And can you paste a complete stack trace so I can see where it's happening?
<https://user-images.githubusercontent.com/66555/262259949-66ec0678-e40b-4fda-95d4-38af3957b699.png>
—
Reply to this email directly, view it on GitHub <#55 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACOP53ZV2YHGDFHUI45WGADXWRJO5ANCNFSM6AAAAAA3Y3TFWY>.
You are receiving this because you authored the thread.
|
Hi,
Getting back at it, when I check out commit a6ff69d, your latest one it does work.
It seems there is an error in some the commits made by Danny.
I didn’t find the error yet.
Cheers,
Niels
… On 22 Aug 2023, at 09:30, Niels Jansen ***@***.***> wrote:
Hi thanks for the reply.
I’m simply using the standard setup, so the sqlite database.
I’ve debugged it , and it’s happening in ‘guests/view.py’ where it tries to count the guests in the table: invited_guest_count = Guest.objects.filter(party_name__is_invited=True).count()
But I don’t understand why it tries to run that, it should only run the migrations first, which somehow it doesn’t do.
See the full trace below:
django-wedding-website via 🐍 v3.11.4 (venv) on master ./manage.py migrate
Invalid line: WEDDING_CC_LIST =[]
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Traceback (most recent call last):
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
return Database.Cursor.execute(self, query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such table: guests_guest
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/ncj/Python Projects/django-wedding-website/./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 89, in wrapped
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 75, in handle
self.check(databases=[database])
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 416, in check
for pattern in self.url_patterns:
^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 602, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ***@***.***/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/ncj/Python Projects/django-wedding-website/bigday/urls.py", line 7, in <module>
url(r'^', include('guests.urls')),
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ***@***.***/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/ncj/Python Projects/django-wedding-website/guests/urls.py", line 3, in <module>
from guests import views
File "/Users/ncj/Python Projects/django-wedding-website/guests/views.py", line 43, in <module>
invited_guest_count = Guest.objects.filter(party_name__is_invited=True).count()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/query.py", line 412, in count
return self.query.get_count(using=self.db)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 528, in get_count
number = obj.get_aggregation(using, ['__count'])['__count']
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/sql/query.py", line 513, in get_aggregation
result = compiler.execute_sql(SINGLE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 79, in _execute
with self.db.wrap_database_errors:
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ncj/Python Projects/django-wedding-website/venv/lib/python3.11/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
return Database.Cursor.execute(self, query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.OperationalError: no such table: guests_guest
> On 22 Aug 2023, at 08:53, Cory Zue ***@***.***> wrote:
>
>
> Strange, I'm not seeing that error on a new project. What DB are you using? And can you paste a complete stack trace so I can see where it's happening?
> <https://user-images.githubusercontent.com/66555/262259949-66ec0678-e40b-4fda-95d4-38af3957b699.png>
> —
> Reply to this email directly, view it on GitHub <#55 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACOP53ZV2YHGDFHUI45WGADXWRJO5ANCNFSM6AAAAAA3Y3TFWY>.
> You are receiving this because you authored the thread.
>
|
Who is Danny? Are you maybe using a fork of this repo? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for the great django project. I'm getting married myself and wanted to use it.
However I'm stuck at
django.db.utils.OperationalError: no such table: guests_guest
when I try to runmanage.py migrate
. Can you please help?The text was updated successfully, but these errors were encountered: