0

I've read several related posts to collecting static files in production, but still can't seem to figure out why collectstatic fails. Why would the following code work with DEBUG = false and not DEBUG = true

When DEBUG is equal to True the following settings works:

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
STATIC_ROOT = '/static/'
STATIC_URL = '/static/' 
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'static'),
)

However when DEBUG is set to false, collect static fails.

My file structure: enter image description here

byrdr
  • 5,197
  • 12
  • 48
  • 78

1 Answers1

0

If your static folder lives in project directory you have to change the setting BASE_DIR according to it ...

BASE_DIR = os.path.dirname(os.path.abspath(__file__) + '../../../')
Raja Simon
  • 10,126
  • 5
  • 43
  • 74