Skip to content Skip to sidebar Skip to footer

Trouble Setting-up Directories To Compile From In Django-assets / Webassets

This is my current assets.py file: from django_assets import Bundle, register sass = Bundle( 'build/main.sass', filters='sass', output='css/main.css' ) register('sass

Solution 1:

A quick point to note:

# This is already in settings.pySTATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]
# After this line STATICFILES_DIRS is `[ 'BASE_DIR/static' ]`# Added new lineASSETS_ROOT = [
    STATICFILES_DIRS,
]
# After this line, ASSETS_ROOT is `[ [ 'BASE_DIR/static' ] ]`# i.e., an array of arrays # I think you actually wanted:ASSETS_ROOT = STATICFILES_DIRS[0] 
# - or more explicitly -ASSETS_ROOT = os.path.normpath(os.path.join(BASE_DIR, 'static'))

That said many of these issues look like they are being caused by a fairly non-standard django structure (i.e., that your manage.py is in the scripts directory rather than in BASE_DIR).

Post a Comment for "Trouble Setting-up Directories To Compile From In Django-assets / Webassets"