Skip to content
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

Issue when run python3 manage.py check #1183

Open
itzdenki opened this issue Jul 5, 2024 · 1 comment
Open

Issue when run python3 manage.py check #1183

itzdenki opened this issue Jul 5, 2024 · 1 comment

Comments

@itzdenki
Copy link

itzdenki commented Jul 5, 2024

Traceback (most recent call last):
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/template/utils.py", line 66, in getitem
return self._engines[alias]
KeyError: 'backend'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "manage.py", line 14, in
execute_from_command_line(sys.argv)
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/core/management/init.py", line 395, in execute
django.setup()
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/contrib/admin/apps.py", line 27, in ready
self.module.autodiscover()
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/contrib/admin/init.py", line 24, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/ubuntu/online-judge/judge/admin/init.py", line 6, in
from judge.admin.comments import CommentAdmin
File "/home/ubuntu/online-judge/judge/admin/comments.py", line 10, in
from judge.widgets import AdminHeavySelect2Widget, AdminMartorWidget
File "/home/ubuntu/online-judge/judge/widgets/init.py", line 3, in
from judge.widgets.mixins import CompressorWidgetMixin
File "/home/ubuntu/online-judge/judge/widgets/mixins.py", line 9, in
class CompressorWidgetMixin(object):
File "/home/ubuntu/online-judge/judge/widgets/mixins.py", line 23, in CompressorWidgetMixin
(False, False): Template(''),
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/template/base.py", line 148, in init
engine = Engine.get_default()
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/template/engine.py", line 76, in get_default
for engine in engines.all():
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/template/utils.py", line 90, in all
return [self[alias] for alias in self]
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/template/utils.py", line 90, in
return [self[alias] for alias in self]
File "/home/ubuntu/venv/lib/python3.8/site-packages/django/template/utils.py", line 81, in getitem
engine = engine_cls(params)
File "/home/ubuntu/venv/lib/python3.8/site-packages/django_jinja/backend.py", line 188, in init
self.env = environment_cls(**options)
File "/home/ubuntu/venv/lib/python3.8/site-packages/jinja2/environment.py", line 365, in init
self.extensions = load_extensions(self, extensions)
File "/home/ubuntu/venv/lib/python3.8/site-packages/jinja2/environment.py", line 119, in load_extensions
extension = t.cast(t.Type["Extension"], import_string(extension))
File "/home/ubuntu/venv/lib/python3.8/site-packages/jinja2/utils.py", line 149, in import_string
return getattr(import(module, None, None, [obj]), obj)
File "/home/ubuntu/venv/lib/python3.8/site-packages/compressor/contrib/jinja2ext.py", line 5, in
from compressor.templatetags import compress
File "/home/ubuntu/venv/lib/python3.8/site-packages/compressor/templatetags/compress.py", line 4, in
from compressor.cache import (
File "/home/ubuntu/venv/lib/python3.8/site-packages/compressor/cache.py", line 14, in
from compressor.storage import default_offline_manifest_storage
File "/home/ubuntu/venv/lib/python3.8/site-packages/compressor/storage.py", line 7, in
from django.core.files.storage import FileSystemStorage, InvalidStorageError, storages
ImportError: cannot import name 'InvalidStorageError' from 'django.core.files.storage' (/home/ubuntu/venv/lib/python3.8/site-packages/django/core/files/storage.py)

@JasonLovesDoggo
Copy link
Contributor

JasonLovesDoggo commented Oct 1, 2024

Not sure how you're setting this up but it seems that you have an outdated version of compressor as InvalidStorageError was moved all the way back in Django 3.0

Try updating your version of compressor with pip install --upgrade django-compressor

(Also this is not an issue with judge-server but rather the site as judge-server does not use compressor)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants