I am trying to use Django-forms with my Django web-app. My app uses the following version of Django.
Django==2.2.6
django-bootstrap3==11.1.0
django-pandas==0.6.1
djangorestframework==3.11.0
the page appears fine on the first load but when I press submit and it gives the following error in the terminal.
ImportError: No module named 'django_excel'
Here is the complete log... Thanks in advance!
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/contrib/staticfiles/handlers.py", line 65, in __call__
return self.application(environ, start_response)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 141, in __call__
response = self.get_response(request)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 75, in get_response
response = self._middleware_chain(request)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 36, in inner
response = response_for_exception(request, exc)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/views/debug.py", line 94, in technical_500_response
html = reporter.get_traceback_html()
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/views/debug.py", line 333, in get_traceback_html
c = Context(self.get_traceback_data(), use_l10n=False)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/views/debug.py", line 305, in get_traceback_data
'filtered_POST_items': list(self.filter.get_post_parameters(self.request).items()),
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/views/debug.py", line 177, in get_post_parameters
return request.POST
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 110, in _get_post
self._load_post_and_files()
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/http/request.py", line 315, in _load_post_and_files
self._post, self._files = self.parse_file_upload(self.META, data)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/http/request.py", line 271, in parse_file_upload
self.upload_handlers,
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/http/request.py", line 259, in upload_handlers
self._initialize_handlers()
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/http/request.py", line 253, in _initialize_handlers
for handler in settings.FILE_UPLOAD_HANDLERS]
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/http/request.py", line 253, in <listcomp>
for handler in settings.FILE_UPLOAD_HANDLERS]
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/core/files/uploadhandler.py", line 205, in load_handler
return import_string(path)(*args, **kwargs)
File "/Users/ritambharachauhan/thoreau-backend-main/venv/lib/python3.5/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 985, in _gcd_import
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
ImportError: No module named 'django_excel'
ERROR "POST /water/thoreau-watermaps HTTP/1.1" 500 59
Related
I'm currently creating a wep app using django with react and django toolbar. The same project worked a weeks ago, but now it gives me this error message. This is the first time I'm using django, i have no idea what's the problem.
Exception ignored in thread started by: \<function check_errors.\<locals\>.wrapper at 0x0000018E6BC28310\>
Traceback (most recent call last):
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\utils\\autoreload.py", line 225, in wrapper
fn(\*args, \*\*kwargs)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\core\\management\\commands\\runserver.py", line 117, in inner_run
self.check(display_num_errors=True)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\core\\management\\base.py", line 376, in check
all_issues = self.\_run_checks(
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\core\\management\\base.py", line 366, in _run_checks
return checks.run_checks(\*\*kwargs)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\core\\checks\\registry.py", line 71, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\core\\checks\\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\core\\checks\\urls.py", line 23, in check_resolver
return check_method()
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\urls\\resolvers.py", line 396, in check
for pattern in self.url_patterns:
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\utils\\functional.py", line 37, in __get__
res = instance.__dict__\[self.name\] = self.func(instance)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\urls\\resolvers.py", line 533, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\utils\\functional.py", line 37, in __get__
res = instance.__dict__\[self.name\] = self.func(instance)
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\urls\\resolvers.py", line 526, in urlconf_module
return import_module(self.urlconf_name)
File "C:\\Users\\nagyd\\AppData\\Local\\Programs\\Python\\Python39\\lib\\importlib_init_.py", line 127, in import_module
return \_bootstrap.\_gcd_import(name\[level:\], package, level)
File "\<frozen importlib.\_bootstrap\>", line 1030, in \_gcd_import
File "\<frozen importlib.\_bootstrap\>", line 1007, in \_find_and_load
File "\<frozen importlib.\_bootstrap\>", line 986, in \_find_and_load_unlocked
File "\<frozen importlib.\_bootstrap\>", line 680, in \_load_unlocked
File "\<frozen importlib.\_bootstrap_external\>", line 855, in exec_module
File "\<frozen importlib.\_bootstrap\>", line 228, in _call_with_frames_removed
File "C:\\Users\\nagyd\\PycharmProjects\\pythonProject\\firstproject\\firstproject\\urls.py", line 27, in \<module\>
path('__debug__/', include('debug_toolbar.urls')),
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\django\\urls\\conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "C:\\Users\\nagyd\\AppData\\Local\\Programs\\Python\\Python39\\lib\\importlib_init_.py", line 127, in import_module
return \_bootstrap.\_gcd_import(name\[level:\], package, level)
File "\<frozen importlib.\_bootstrap\>", line 1030, in \_gcd_import
File "\<frozen importlib.\_bootstrap\>", line 1007, in \_find_and_load
File "\<frozen importlib.\_bootstrap\>", line 986, in \_find_and_load_unlocked
File "\<frozen importlib.\_bootstrap\>", line 680, in \_load_unlocked
File "\<frozen importlib.\_bootstrap_external\>", line 855, in exec_module
File "\<frozen importlib.\_bootstrap\>", line 228, in \_call_with_frames_removed
File "C:\\Users\\nagyd.virtualenvs\\pythonProject\\lib\\site-packages\\debug_toolbar\\panels\\settings.py", line 7, in \<module\>
get_safe_settings = get_default_exception_reporter_filter().get_safe_settings
AttributeError: 'SafeExceptionReporterFilter' object has no attribute 'get_safe_settings'
Hope that i can be advised on this thank you! :(
I did a pip install -r requirements.txt and after that, realized that my development server could nolonger start. I have been unable to tell which of the files installed caused this. I even tried to re-install a previous requirements.txt file I had before this one but the nothing changed.
Could anyone be having a clue on what exactly is happening from this traceback message?
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 419, in check
all_issues = checks.run_checks(
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 412, in check
for pattern in self.url_patterns:
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 598, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 591, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "D:\Programming\Javascript\React\llr_reacted\llr_django\library\urls.py", line 6, in <module>
from libman import views as core_views
File "D:\Programming\Javascript\React\llr_reacted\llr_django\libman\views.py", line 22, in <module>
from rest_framework.decorators import api_view
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\rest_framework\decorators.py", line 13, in <module>
from rest_framework.views import APIView
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\rest_framework\views.py", line 17, in <module>
from rest_framework.schemas import DefaultSchema
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\rest_framework\schemas\__init__.py", line 33, in <module>
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\rest_framework\settings.py", line 225, in __getattr__
val = perform_import(val, attr)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\rest_framework\settings.py", line 168, in perform_import
return [import_from_string(item, setting_name) for item in val]
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\rest_framework\settings.py", line 168, in <listcomp>
return [import_from_string(item, setting_name) for item in val]
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\rest_framework\settings.py", line 177, in import_from_string
return import_string(val)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\module_loading.py", line 17, in import_string
module = import_module(module_path)
File "C:\Users\Ptar\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ValueError: source code string cannot contain null bytes
This is what was contained in the requirements.txt that I installed.
asgiref==3.4.1
autopep8==1.6.0
Django==4.0.1
django-cors-headers==3.11.0
djangorestframework==3.13.1
djangorestframework-simplejwt==5.0.0
pycodestyle==2.8.0
PyJWT==2.3.0
pytz==2021.3
sqlparse==0.4.2
toml==0.10.2
tzdata==2021.5
I'm currently updating my website to use Django 3.2, but I use the zinnia blog which is no longer receiving updates. I'm making the necessary changes to bring it up to compatibility with 3.2 but I'm now getting the error that the AbstractEntry table doesn't exist. This is, however, an abstract table so I'm confused why it would try to find the table at all.
Full traceback:
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/usr/local/lib/python3.8/dist-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.8/dist-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/usr/local/lib/python3.8/dist-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.8/dist-packages/zinnia/models/__init__.py", line 4, in <module>
from zinnia.models.entry import Entry
File "/usr/local/lib/python3.8/dist-packages/zinnia/models/entry.py", line 6, in <module>
class Entry(load_model_class(ENTRY_BASE_MODEL)):
File "/usr/local/lib/python3.8/dist-packages/zinnia/models_bases/__init__.py", line 18, in load_model_class
_class = getattr(import_module(module_name), class_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.8/dist-packages/zinnia/models_bases/entry.py", line 552, in <module>
class AbstractEntry(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 273, in __new__
new_class.add_to_class(field.name, new_field)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 321, in add_to_class
value.contribute_to_class(cls, name)
File "/usr/local/lib/python3.8/dist-packages/tagging/fields.py", line 26, in contribute_to_class
super(TagField, self).contribute_to_class(cls, name)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/__init__.py", line 743, in contribute_to_class
if not getattr(cls, self.attname, None):
File "/usr/local/lib/python3.8/dist-packages/tagging/fields.py", line 55, in __get__
return edit_string_for_tags(Tag.objects.usage_for_model(owner))
File "/usr/local/lib/python3.8/dist-packages/tagging/models.py", line 160, in usage_for_model
usage = self.usage_for_queryset(queryset, counts, min_count)
File "/usr/local/lib/python3.8/dist-packages/tagging/models.py", line 185, in usage_for_queryset
return self._get_usage(queryset.model, counts, min_count,
File "/usr/local/lib/python3.8/dist-packages/tagging/models.py", line 125, in _get_usage
cursor.execute(query % (extra_joins, extra_criteria, min_count_sql),
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1146, "Table 'somesmart_django.zinnia_abstractentry' doesn't exist")
root#server:/home/scott/somesmart# python manage.py makemigrations zinnia
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.ProgrammingError: (1146, "Table 'somesmart_django.zinnia_abstractentry' doesn't exist")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/usr/local/lib/python3.8/dist-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.8/dist-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/usr/local/lib/python3.8/dist-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.8/dist-packages/zinnia/models/__init__.py", line 4, in <module>
from zinnia.models.entry import Entry
File "/usr/local/lib/python3.8/dist-packages/zinnia/models/entry.py", line 6, in <module>
class Entry(load_model_class(ENTRY_BASE_MODEL)):
File "/usr/local/lib/python3.8/dist-packages/zinnia/models_bases/__init__.py", line 18, in load_model_class
_class = getattr(import_module(module_name), class_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.8/dist-packages/zinnia/models_bases/entry.py", line 552, in <module>
class AbstractEntry(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 273, in __new__
new_class.add_to_class(field.name, new_field)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 321, in add_to_class
value.contribute_to_class(cls, name)
File "/usr/local/lib/python3.8/dist-packages/tagging/fields.py", line 26, in contribute_to_class
super(TagField, self).contribute_to_class(cls, name)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/__init__.py", line 743, in contribute_to_class
if not getattr(cls, self.attname, None):
File "/usr/local/lib/python3.8/dist-packages/tagging/fields.py", line 55, in __get__
return edit_string_for_tags(Tag.objects.usage_for_model(owner))
File "/usr/local/lib/python3.8/dist-packages/tagging/models.py", line 160, in usage_for_model
usage = self.usage_for_queryset(queryset, counts, min_count)
File "/usr/local/lib/python3.8/dist-packages/tagging/models.py", line 185, in usage_for_queryset
return self._get_usage(queryset.model, counts, min_count,
File "/usr/local/lib/python3.8/dist-packages/tagging/models.py", line 125, in _get_usage
cursor.execute(query % (extra_joins, extra_criteria, min_count_sql),
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1146, "Table 'somesmart_django.zinnia_abstractentry' doesn't exist")
The abstract entry model:
class AbstractEntry(
CoreEntry,
ContentEntry,
DiscussionsEntry,
RelatedEntry,
LeadEntry,
ExcerptEntry,
ImageEntry,
FeaturedEntry,
AuthorsEntry,
CategoriesEntry,
TagsEntry,
LoginRequiredEntry,
PasswordRequiredEntry,
ContentTemplateEntry,
DetailTemplateEntry):
"""
Final abstract entry model class assembling
all the abstract entry model classes into a single one.
In this manner we can override some fields without
reimplemting all the AbstractEntry.
"""
class Meta(CoreEntry.Meta):
abstract = True
managed = False
In Meta class you have to specify managed=False to prevent orm creation
https://docs.djangoproject.com/en/3.2/ref/models/options/#managed
I am not fluent in Django,been doing for over 3 months now, BUT I have never seen such error. Please if someone can help me out of this situation.
I am doing the short_url module, bt befoe that i have pip installed shorturls , then i created an app shorturls. Again , i have to delte the app shorturls. And after that i have been facing this issue.
Following is my full traceback of the error:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\utils.py", line 66, in __getitem__
return self._engines[alias]
KeyError: 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\backends\django.py", line 121, in get_package_libraries
module = import_module(entry[1])
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\shorturls\templatetags\shorturl.py", line 5, in <module>
from django.core import urlresolvers
ImportError: cannot import name 'urlresolvers' from 'django.core' (C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\__init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\blink\myblink\manage.py", line 23, in <module>
main()
File "C:\blink\myblink\manage.py", line 19, in main
execute_from_command_line(sys.argv)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
utility.execute()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 61, in execute
super().execute(*args, **options)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 398, in execute
output = self.handle(*args, **options)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 96, in handle
self.run(**options)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 103, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 637, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 622, in start_django
reloader.run(django_main_thread)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 327, in run
autoreload_started.send(sender=self)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\dispatch\dispatcher.py", line 180, in send
return [
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\dispatch\dispatcher.py", line 181, in <listcomp>
(receiver, receiver(signal=self, sender=sender, **named))
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\autoreload.py", line 41, in watch_for_template_changes
for directory in get_template_directories():
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\autoreload.py", line 14, in get_template_directories
for backend in engines.all():
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\utils.py", line 90, in all
return [self[alias] for alias in self]
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\utils.py", line 90, in <listcomp>
return [self[alias] for alias in self]
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\utils.py", line 81, in __getitem__
engine = engine_cls(params)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\backends\django.py", line 25, in __init__
options['libraries'] = self.get_templatetag_libraries(libraries)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\backends\django.py", line 43, in get_templatetag_libraries
libraries = get_installed_libraries()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\backends\django.py", line 108, in get_installed_libraries
for name in get_package_libraries(pkg):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\backends\django.py", line 123, in get_package_libraries
raise InvalidTemplateLibrary(
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'shorturls.templatetags.shorturl': cannot
import name 'urlresolvers' from 'django.core' (C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\__init__.py)
I want to use Memcached in my Django 1.11 project. I am using Python 3.6.
I have installed memcached on my mac OSX terminal with Homebrew. After that I installed its python bindings:
pip install python-memchached==1.58
I then add the necessary configurations to my settings.py project file:
CACHES = {
'default': {
'BACKEND':'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION':'127.0.0.1:11211',
}
}
I two terminals, one for my local host and the second one for memcached:
memcached -l 127.0.0.1:11211
When I refresh my web page I get the following error:
System check identified no issues (0 silenced).
October 15, 2017 - 10:47:30
Django version 1.11.6, using settings 'educa.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Internal Server Error: /
Traceback (most recent call last):
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/utils.py", line 65, in __getitem__
return self._engines[alias]
KeyError: 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/backends/django.py", line 126, in
get_package_libraries
module = import_module(entry[1])
File
"/Users/comp/Desktop/Dev/educa/lib/python3.6/importlib/__init__.py",
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in
exec_module
File "<frozen importlib._bootstrap>", line 205, in
_call_with_frames_removed
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/memcache_status/templatetags/memcache_status_tags.py", line
3, in <module>
from django.core.cache import get_cache
ImportError: cannot import name 'get_cache'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/core/handlers/base.py", line 217, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/core/handlers/base.py", line 215, in _get_response
response = response.render()
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/response.py", line 107, in render
self.content = self.rendered_content
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/response.py", line 82, in rendered_content
template = self.resolve_template(self.template_name)
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/response.py", line 64, in resolve_template
return select_template(template, using=self.using)
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/loader.py", line 44, in select_template
engines = _engine_list(using)
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/loader.py", line 72, in _engine_list
return engines.all() if using is None else [engines[using]]
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/utils.py", line 89, in all
return [self[alias] for alias in self]
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/utils.py", line 89, in <listcomp>
return [self[alias] for alias in self]
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/utils.py", line 80, in __getitem__
engine = engine_cls(params)
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/backends/django.py", line 30, in __init__
options['libraries'] = self.get_templatetag_libraries(libraries)
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/backends/django.py", line 48, in
get_templatetag_libraries
libraries = get_installed_libraries()
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/backends/django.py", line 113, in
get_installed_libraries
for name in get_package_libraries(pkg):
File "/Users/comp/Desktop/Dev/educa/lib/python3.6/site-
packages/django/template/backends/django.py", line 130, in
get_package_libraries
"trying to load '%s': %s" % (entry[1], e)
django.template.library.InvalidTemplateLibrary: Invalid template
library specified. ImportError raised when trying to load
'memcache_status.templatetags.memcache_status_tags': cannot import
name 'get_cache'
[15/Oct/2017 10:47:33] "GET / HTTP/1.1" 500 131841
Can anyone point me to a solution for my issue ?