天天看點

Django靜态檔案路徑設定

提示 :

Error fetching command 'collectstatic': You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.

Command 'collectstatic' skipped

Django靜态檔案路徑設定
解決方法:settings.py添加

1 STATIC_ROOT = os.path.join(BASE_DIR, '/static/')
2 
3 STATIC_URL = '/static/'
4 STATICFILES_DIRS = [
5     os.path.join(BASE_DIR,'static')
6 ]