我将我的Django应用部署到了pythonanywhere.com,但我的管理界面CSS没有生效。请看http://directdirect.pythonanywhere.com/admin/login/?next=/admin/。我使用的是Django 2.0。settings.py文件如下:
Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'django_direct/main_app/static'),
os.path.join(BASE_DIR, 'django_direct/main_app/static'),
http://directdirect.pythonanywhere.com/static/admin/css/dashboard.css
]
STATIC_ROOT
设置指向哪里?你能检查一下服务器上的文件是否在它们应该在的位置吗? - RalfSTATIC_ROOT
也展示出来,不只是STATIC_URL
吗? - Ralf