2016-02-18 220 views
4

我試圖使用cmd以創建一個超級用戶模塊但我每次運行命令時,我得到:Django的沒有名爲「壓縮機」

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是spasing在我身上?

+0

不得不嘗試這一個http://django-compressor.readthedocs.org/ en/latest/quickstart/ –

+0

我剛剛刪除了django-compressor,並嘗試使用該鏈接,因爲這是我之前看到的,但現在它給了我安裝問題 – john

回答

8

所以幾乎我不得不使用我的本地PIP安裝Django的壓縮機,所以對於某種原因,它不是利用我的虛擬環境壓縮機

+5

缺少的軟件包是'django-compressor' ** NOT **'django_compressor' –