[Fixed]-Trouble setting-up directories to compile from in Django-Assets / Webassets

1๐Ÿ‘

โœ…

A quick point to note:

# This is already in settings.py
STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]
# After this line STATICFILES_DIRS is `[ 'BASE_DIR/static' ]`

# Added new line
ASSETS_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).

๐Ÿ‘ค2ps

Leave a comment