2013-10-30 3 views
2

내 정적 자산을 관리하고 coffeescript 및 SCSS 파일을 모두 컴파일하는 데 django-pipeline을 사용하고 있습니다. 이 장고 앱의 구성에 문제가 있습니다. 달성하고자하는 것은 django-pipeline에 대한 자산/하위 디렉토리에서 내 coffeescript 및 SCSS 파일을 읽고 컴파일하고 공공/하위 디렉토리에 압축하여 장고에게 정적 파일을 제공하도록 알려주는 것입니다. 참고로Django 자산 파이프 라인

, 내 장고 파일 구조는 다음과 같다 : 나의 현재 장고 설정 (간결함을 위해 생략 관련이없는 물건) 아래처럼 보이는

DjangoApp 
    assets 
     coffeescript 
     scss 
    bin 
    configs 
    db 
    logs 
    DjangoApp 
    public 
     css 
     images 
     js 
    requirements 

:

# Absolute path to the directory static files should be collected to. 
# Don't put anything in this directory yourself; store your static files 
# in apps' "static/" subdirectories and in STATICFILES_DIRS. 
# Example: "/var/www/example.com/static/" 
STATIC_ROOT = '' 

# URL prefix for static files. 
# Example: "http://example.com/static/", "http://static.example.com/" 
STATIC_URL = '/public/' 

# Additional locations of static files 
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static". 
    # Always use forward slashes, even on Windows. 
    # Don't forget to use absolute paths, not relative paths. 
    PROJECT_PATH + '/public', 
) 

# Asset compilers. 
PIPELINE_COMPILERS = (
    'pipeline.compilers.coffee.CoffeeScriptCompiler', 
    'pipeline.compilers.sass.SASSCompiler' 
) 

PIPELINE_CSS = { 
    'ie': { 
     'source_filenames': (
      'scss/ie.scss', 
     ), 
     'output_filename': 'css/ie.min.css' 
    }, 
    'print': { 
     'source_filenames': (
      'scss/print.scss', 
     ), 
     'output_filename': 'css/print.min.css' 
    }, 
    'screen': { 
     'source_filenames': (
      'scss/screen.scss', 
      'scss/screen-responsive-768px.scss', 
      'scss/screen-responsive-992px.scss', 
      'scss/screen-responsive-1200px.scss' 
     ), 
     'output_filename': 'css/screen.min.css' 
    } 
} 

PIPELINE_JS = { 
    'application': { 
     'source_filenames': (
      'coffeescript/application.coffee', 
     ), 
     'output_filename': 'js/application.min.js', 
    } 
} 

아마도이 응용 프로그램은 할 수 없습니다 내가 원하는 것을해라. 다른 뭔가를 찾아야할까요?

답변

3

나는 이것을 한동안 놀았으며, 운이 없었습니다. 그러나 나는 정확히 내가 원하는 것을 python gears 또는 django-gears에서 찾았습니다. 내가 달성하기를 원하는 것을 고려하면 루비 sprockets을 복제하는 것이 완벽 할 것입니다.

관련 문제