2017-09-11 1 views
0

Il est quelques dernières lignes de retraçage:django-pipeline FileNotFoundError quand j'exécute manage.py collectstatic

File "C:\PycharmDev\TestVirtualEnv\testEnv1\lib\site-packages\pipeline\compressors\__init__.py", line 247, in execute_command 
    stdin=subprocess.PIPE, stderr=subprocess.PIPE) 
    File "C:\Python34\Lib\subprocess.py", line 859, in __init__ 
    restore_signals, start_new_session) 
    File "C:\Python34\Lib\subprocess.py", line 1112, in _execute_child 
    startupinfo) 
FileNotFoundError: [WinError 2] ... 

Et settings.py:

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 

STATIC_URL = '/static/' 
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' 
STATIC_URL = '/static_prepared/' 
STATIC_ROOT = os.path.join(BASE_DIR, 'static') 
STATICFILES_DIRS = [ 
    os.path.join(BASE_DIR, 'static_prepared'), 
] 
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder', 
    'django.contrib.staticfiles.finders.AppDirectoriesFinder', 
    'pipeline.finders.PipelineFinder', 
) 
PIPELINE = { 
    'STYLESHEETS': { 
     'static_prepared': { 
      'source_filenames': (
       '*.css', 
      ), 
      'output_filename': 'colors.css' 
     }, 
    }, 
    'JAVASCRIPT': { 
     'static_prepared': { 
      'source_filenames': (
       '*.js', 
      ), 
      'output_filename': 'stats.js', 
     } 
    } 
} 

Quel est le problème avec moi? Quand j'utilise manage.py collectstatic, cela ne fonctionne pas du tout avec un pipeline.

Il semble que cela fonctionne comme s'il n'y avait pas de pipeline.

La même chose que sans pipeline. Normal manage.py collectstatic.

Pourquoi cette erreur s'est-elle produite?

J'ai déjà fait le répertoire statique et static_prepared sur os.path.join (BASE_DIR, ...) manuellement.

Comment puis-je définir le pipeline correctement?

Répondre

1

Remplacer un autre nom comme

PIPELINE = { 
    'STYLE': { 
     'static_prepared': { 
      'source_filenames': (
       '*.css', 
      ), 
      'output_filename': 'colors.css' 
     }, 
    }, 
    'JSCRIPT': { 
     'static_prepared': { 
      'source_filenames': (
       '*.js', 
      ), 
      'output_filename': 'stats.js', 
     } 
    } 
}