python manage.py syncdb T-6ren">
gpt4 book ai didi

python - Django 没有名为 "compressor"的模块

转载 作者:太空狗 更新时间:2023-10-29 22:10:50 29 4
gpt4 key购买 nike

我正在尝试使用 cmd 创建 super 用户,但每次运行命令时我都会得到:

C:\Users\PCDOM\Desktop\Power\pm_app>python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 17, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
338, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
312, in execute
django.setup()
File "C:\Python27\lib\site-packages\django\__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Python27\lib\site-packages\django\apps\registry.py", line 85, in popu
late
app_config = AppConfig.create(entry)
File "C:\Python27\lib\site-packages\django\apps\config.py", line 86, in create

module = import_module(entry)
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named compressor

即使我已将它安装在我的虚拟环境和我的 settings.py 中:

enter image description here

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
#'bootstrap3',
'promo',
'ums',
'compressor',
#'sqlserver_ado',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
)

STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
'compressor.finders.CompressorFinder',
)

django 对我发脾气有什么原因吗?

最佳答案

我几乎不得不使用我的本地 pip 安装 django-compressor,所以出于某种原因它没有使用我的虚拟环境压缩器

关于python - Django 没有名为 "compressor"的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35484558/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com