我读过这个: Django - 找不到静态文件
但我仍然很困惑,因为我的项目应用程序的静态文件之一正在被提供。我认为问题在于 django-weasyprint 设置:
设置.py
>>> settings.BASE_DIR
'/Users/blakepowell/django_/direct2'
>>> settings.STATIC_ROOT
'/static/'
>>> settings.BASE_DIR
'/Users/blakepowell/django_/direct2'
>>> settings.DJANGO_ROOT
'/Users/blakepowell/django_/direct2'
>>> settings.STATICFILES_DIRS
['/Users/blakepowell/django_/direct2/flights/static/', '/Users/blakepowell/django_/direct2/pdf_output/static/']
每个django-weasyprint 的pdf_output/views.py
class PrintView(WeasyTemplateResponseMixin, PDFView):
# None
pdf_stylesheets = [
settings.STATIC_ROOT + 'pdf_output/static/pdf_output/css/pdf_output.css',
]
错误
[Errno 2] No such file or directory: '/static/pdf_output/static/pdf_output/css/pdf_output.css'
有任何想法吗?