我正在学习使用Django并尝试在Heroku上部署项目。当我尝试通过命令窗口部署项目时,我在运行python manage.py collectstatic
Improperly Configured: You're using the staticfiles app without having set
the STATIC_ROOT setting to a filesystem path.
我对heroku的设置是:
if os.getcwd() == '/app':
import dj_database_url
DATABASES = {
'default': dj_database_url.config(default='postgres://localhost')
}
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = [*]
# Static set configuration
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = 'staticfiles'
STATICFILES_DIR = (
os.path.join(BASE_DIR, 'static'),
)
我是django的新手,感谢您的帮助,谢谢。